
Publication 1746-UM004A-US-P
Programming Overview
4-7
Refer to the
BASIC Language Reference Manual
(publication number
1747-RM001A-US-P) for additional information on these statements.
Creating and Editing a
BASIC Program
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.
( ) < ( )
Allow the first expression to be less than the second
expression.
9<10
( ) <= ( )
Allow the first expression to be less than or equal to the
second expression.
X<=10
( ) > ( )
Allow the first expression to be greater than the second
expression.
10>9
( ) >= ( )
Allow the first expression to be greater than or equal to the
second expression.
X>=10
( ) <> ( )
Allows the first expression to be unequal to the second
expression.
10<>9
Table 4.6 BASIC Operators
Operator
Function
Examples
IMPORTANT
Reuse of an existing line number causes all of the information
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.
Содержание 1746-BAS
Страница 4: ...Publication 1746 UM004A US P Summary of Changes ii...
Страница 8: ...Publication 1746 UM004A US P Table of Contents iv...
Страница 26: ...Publication 1746 UM004A US P 1 14 Module and Development Software Overview...
Страница 34: ...Publication 1764 UM001A US P 2 8 Component Selection...
Страница 70: ...Publication 176 UM04A US P A 4 Specifications...
Страница 83: ...Spare Allen Bradley Parts...