Incr, Decr

Fast incrementation or decrementation by 1 (x = x +/- 1). This gives a speed advantage for data types byte, word, integer, long, when accessing arrays and structures. Will also work on floating values, but without a speed advantage.


  1. Incr Variable
  2. Decr Variable

Syntax (alternative)

  1. Variable++
  2. Variable--

Variable includes numeric properties in structures.


  dim a(100) as byte
  dim b as integer
  incr a(4)  ' increment 5th element of Array "a" by 1
  decr a(4)  ' decrement 5th element of Array "a" by 1
  incr b     ' increment variable "b" by 1


  ' Declare structure
  struct date
    byte hour
    byte minute
    byte second
    byte value(5)
  ' Dimension d as a structure
  dim d as date
  incr d.hour     ' increment "hour" by 1
  incr d.wert(3)  ' increment 4th element of "value" by 1
  decr d.wert(3)  ' decrement 4th element of "value" by 1