Processing:Справочник языка Processing/IntDict/increment(): различия между версиями

Материал из Онлайн справочника
Перейти к навигацииПерейти к поиску
Нет описания правки
 
Нет описания правки
Строка 2: Строка 2:
{{Myagkij-редактор}}
{{Myagkij-редактор}}


{{Черновик}}
 


= increment() <ref>[https://processing.org/reference/IntDict_increment_.html processing.org - increment()]</ref>=
= increment() <ref>[https://processing.org/reference/IntDict_increment_.html processing.org - increment()]</ref>=
Строка 8: Строка 8:
==Обозначение==
==Обозначение==


<syntaxhighlight lang="c" enclose="div">
<syntaxhighlight lang="c">
increment()
increment()
</syntaxhighlight>
</syntaxhighlight>
Строка 18: Строка 18:
==Синтаксис==
==Синтаксис==


<syntaxhighlight lang="c" enclose="div">
<syntaxhighlight lang="c">
.increment(key)
.increment(key)
.increment(dict)
.increment(dict)
Строка 25: Строка 25:
==Параметры==
==Параметры==


<syntaxhighlight lang="c" enclose="div">
<syntaxhighlight lang="c">
key  - тип String: ключ
key  - тип String: ключ
dict - тип IntDict:  
dict - тип IntDict:  
Строка 32: Строка 32:
==Возвращаемое значение==
==Возвращаемое значение==


<syntaxhighlight lang="c" enclose="div">
<syntaxhighlight lang="c">
void
void
</syntaxhighlight>
</syntaxhighlight>
Строка 38: Строка 38:
==Пример==
==Пример==


<syntaxhighlight lang="c" line="GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS" enclose="div">
<syntaxhighlight lang="c" line="GESHI_NORMAL_LINE_NUMBERS|GESHI_FANCY_LINE_NUMBERS">
IntDict inventory;
IntDict inventory;


Строка 74: Строка 74:
|Высота логотипа издателя для schemaNewsArticle=45
|Высота логотипа издателя для schemaNewsArticle=45
}}
}}
{{Навигационная таблица/Справочник языка Processing}}
{{Навигационная таблица/Портал/Processing}}

Версия от 12:03, 20 мая 2023

Проверка/Оформление/Редактирование: Мякишев Е.А.



increment() [1]

Обозначение

increment()

Описание

Увеличивает значение определенного ключа на 1.

Синтаксис

.increment(key)
.increment(dict)

Параметры

key  - тип String: ключ
dict - тип IntDict:

Возвращаемое значение

void

Пример

IntDict inventory;

void setup() {
  size(200, 200);
  inventory = new IntDict();
  inventory.set("cd", 84);
  inventory.set("tapes", 15);
  inventory.set("records", 102);
  println(inventory);             // ключу "tapes" соответствует целочисленное значение 15
  inventory.increment("tapes");
  println(inventory);             // ключу "tapes" теперь соответствует целочисленное значение 16 
}

См.также

Внешние ссылки