clear()

clear() is used to remove all the elements. This method does not require any arguments.

It is not identical to the usage of the INITIALIZE TO NULL statement, because the statement removes only the values leaving the array elements intact.

Syntax:

ar.Clear()

Usage example:

clear() can also be used with multi-dimensional dynamic arrays:

DEFINE ar DYNAMIC ARRAY OF CHAR(15)
...
  FOR i = 1 TO 5                 #the array has 5 elements
    LET ar[i]="element "||i
  END FOR
CALL ar.clear()                  #the array has no elements

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.