Clr, Clear

Fast clearing (set to 0) of a variable, array, structure or structure property. Beware of Data Type Memory Block! Here you should use the Release method of that object instead of erasing the reference, otherwise the referenced memory will be inaccessible. Syntax:

  1. Clr Variable - Set Variable value to zero
  2. Clr Variable() - Set all element values of the array to zero

Variable includes declared structures. In this case, all values of that structure will be set to zero.You may also set individual properties of a structure to zero, array elements or a whole array of a structure.


  dim a(100) as byte
  dim b as integer
  dim s as string
  clr a(4)  ' set 5th element of array "a" to 0
  clr a()   ' set whole array "a" to 0
  clr b     ' set b to 0
  clr s     ' set string to ""


  ' declare structure
  struct date
    byte hour
    byte minute
    byte second
    byte wert(5)
  ' declare such a structure
  dim d as date
  clr d.hour    ' set hour to 0
  clr d         ' set all values to 0
  clr d.value(3) ' set 4th element of array "value" to 0
  clr d.value()  ' set whole array "value" to 0