Assignment functions, Clear, Chapter 6 – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual
Page 77: Clear -1, Chapter, Purpose, Syntax

1
Publication 1746-RM001A-US-P
Chapter
6
Assignment Functions
This chapter describes and illustrates commands that assign storage, reset data
storage, and values to variables within the BASIC program or from the command
line. Table 6.1 lists the corresponding mnemonics.
CLEAR
Purpose
Use the CLEAR statement to set all variables equal to 0 and reset all BASIC evoked
interrupts and stacks. This means that after the CLEAR statement is executed, an
ONTIME statement must be executed before the module acknowledges the
internal timer interrupts. ERROR trapping with the ONERR statement also does
not occur until an ONERR [ln num] statement is executed.
The CLEAR statement does not affect the free running clock that is enabled by the
CLOCK1 statement. CLOCK0 is the only module statement that can disable the
free running clock.
CLEAR also does not reset the memory that has been allocated for strings, so it is
not necessary to enter the STRING [exp], [expr] statement to re-allocate memory
for strings after the CLEAR statement is executed. In general, CLEAR is used to
erase all variables.
Syntax
CLEAR
Table 6.1 Chapter Reference Guide
If you need (to)
Use this mnemonic Page
Clear variables, interrupts & strings.
CLEAR
Clear interrupts.
CLEARI
Clear all stacks.
CLEARS
Data read by Read statement.
DATA
Allocate memory for array variables.
DIM
Assign a variable or a string a value (LET is optional).
LET
RESTORE read pointer.
RESTORE