Creating and Editing a
BASIC Program
Spare Allen-Bradley Parts
Table 4.6 BASIC Operators
Operator
Function
( ) < ( )
Allow the first expression to be less than the second
expression.
( ) <= ( )
Allow the first expression to be less than or equal to the
second expression.
( ) > ( )
Allow the first expression to be greater than the second
expression.
( ) >= ( )
Allow the first expression to be greater than or equal to the
second expression.
( ) <> ( )
Allows the first expression to be unequal to the second
expression.
Refer to the BASIC Language Reference Manual (publication number
1747-RM001A-US-P) for additional information on these statements.
Module execution is controlled through a BASIC program residing in RAM or
ROM. You have the option of creating and editing this program:
• either on a personal computer using the BASIC development software and
then downloading it to the module. BASIC development software uses an
MS-DOS compatible personal computer to facilitate editing, compiling
(translating), uploading, and downloading BASIC programs. Refer to the
BASIC Development Software Programming Manual (publication number
1747-PM001A-US-P) for additional information on the BASIC development
software.
• or entering the program one line at a time directly to the module using an
ASCII terminal. ASCII terminal programming must be done one line at a
time.
Entering a BASIC Program Using an ASCII Terminal
BASIC line numbers indicate the order in which the program lines are stored in
memory. They are also used as references when branching and editing. Typically
you start numbering BASIC programs with line number 10 and increment by 10.
This allows you to add additional lines later as you work on your program.
Since the computer runs the statements in numerical order, additional lines need
not appear in consecutive order on the screen. For example, if you enter line 35
after line 40, the computer still runs line 35 after line 30 and before line 40. This
technique saves you from re-entering an entire program if you forget to include a
line.
Reuse of an existing line number causes all of the information
IMPORTANT
referenced by the original line number to be lost. Be careful when
entering numbers in the Command mode; you may accidentally
erase some program lines.
Programming Overview
4-7
Examples
9<10
X<=10
10>9
X>=10
10<>9
Publication 1746-UM004A-US-P
Need help?
Do you have a question about the SLC 500 BASIC and is the answer not in the manual?
Questions and answers