Name

increment()

Class

IntDict

Description

Increase the value of a specific key value by 1

Examples

  • IntDict inventory;
    
    void setup() {
      size(200, 200);
      inventory = new IntDict();
      inventory.set("cd", 84);
      inventory.set("tapes", 15);
      inventory.set("records", 102);
      println(inventory);  // There are 15 tapes
      inventory.increment("tapes");
      println(inventory);  // There are now 16 tapes
    }
    
    

Syntax

  • .increment(key)
  • .increment(dict)

Return

  • void