:CLEAR

Use the :CLEAR script statement to reset a script array that has already been used to its initial values. All existing values are deleted, and the array is reset to the status immediately after its original declaration. For more information about declaring arrays, see :DEFINE.

Note: :CLEAR only deletes the content of the array. The variable is not deleted. You cannot use :CLEAR to redefine the array.

Syntax

:CLEAR Script array

Parameters

  • :CLEAR
    Resets a script array to its initial values

  • Script array
    Variable name of the script array to reset
    Specify the name of the script array with empty index brackets [].
    Format: script variable

Example

The following example defines and fills an array with the values from a line in a static VARA object. The values are printed in the activation report. Subsequently, the array is emptied, and filled with values from a different line. The new values are also printed in the activation report.

:DEFINE &ARRAY#, string, 5
:DEFINE &STR#, string
:FILL &ARRAY#[] = GET_VAR(VARA.STATIC.TEST,"KEY01")
:SET &STR# = ARRAY_2_STRING(&ARRAY#[])
:P "KEY01: &STR#"
:CLEAR &ARRAY#[]
:FILL &ARRAY#[] = GET_VAR(VARA.STATIC.TEST,"KEY02")
:SET &STR# = ARRAY_2_STRING(&ARRAY#[])
:P "KEY02: &STR#"

See also: