CLEAR


ANSI, NCHAR

 

The CLEAR instruction resets both the Form Pointer and Length Pointer of a character variable to zero, or sets the value of a numeric variable to zero. The instruction uses the following format:

 

 

[label]

CLEAR

{dest}

 

Where:

label

Optional. A Program Execution Label.

dest

Required. A previously defined Character String Variable, a National Character String Variable, a Numeric Variable, a list of string and/or numeric variables, or a VARLIST of string and/or numeric variables that is processed.

Flags Affected: NONE

Note the following:

  1. Both the Form Pointer and Length Pointer of a character variable are set to zero. The contents remain unchanged.

  2. The value of a numeric variable is set to zero.

  3. The ability to clear numeric variables was added in version 7.8.

  4. Enhanced ARRAY processing is supported for the CLEAR instruction, in that each element in the array would have its Form Pointer and Length Pointer set to zero.

 

 

See Also: Example Code, FILL, SET, TEST, Character String Instructions

 



PL/B Language Reference CHOP CMATCH