Specifications
Commands - 14
CLEAR
Statement
SYNTAX: CLEAR [string]
PURPOSE: To set all numeric variables to zero, set all string variables to null, restore the data pointer, and negate
all DIM statements. You can optionally set the string space size.
REMARKS: If the optional parameter string is specified, variables are cleared and the string space is made equal to
the number of bytes specified. 100 bytes is the default value on power–up.
NOTE: You do not need to clear string space for string arrays. The DIM statement does this
automatically.
RELATED: none
EXAMPLE: The following clears all variables and sets the string space to 100 bytes:
10 CLEAR
The following clears all variables and reserves 500 bytes of RAM for strings:
10 CLEAR 500
ERROR: <Data negative> – for string
<Out of memory> – if an attempt is made to clear more memory than is available