Auto Command - IBM 5100 Basic Reference Manual

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

AUTO [Iine-num [,incrementl]
10
AUTO COMMAND
The AUTO command allows you to initiate automatic line numbering for BASIC
statements. Automatic numbering simplifies the task of entering statements in a
BASIC program. You can specify both the beginning statement number and the
increment between numbers. After you enter a statement and press,EXECUTE, the
next statement number is generated and displayed. The syntax of the AUTO com-
mand is as shown:
AUTO [line-num [,incrementl]
where:
line-num
is a positive integer specifying the first statement number to be
generated. The range of this number is 1 to 9999. If a beginning number is not
specified, a beginning number of 0010 and an increment of 10 are generated.
increment
is a positive integer used to increment succeeding statement numbers.
If a beginning line number is not specified, the increment cannot be specified. The
default is 10 for this optional entry.
Each statement number generated by the AUTO command is followed by a blank,
then the cursor, as shown:
0010
Note About AUTO
Automatic numbering continues until any other valid data, a command word, for
example, or a statement number other than the displayed number is entered in the
input line. In this case, another AUTO command must be entered in order to con-
tinue automatic numbering. Another way to terminate AUTO numbering is to press
the scroll up key, which will display a new unnumbered line.
Example
The following examples show AUTO commands:
AUTO (then press EXECUTE)
In this example, the display screen will show statement number 0010. After you
press EXECUTE at the end of an entered statement, the statement number automat-
ically increases by 10, producing statement numbers 0020, 0030, 0040, and so on.
In the following example, the beginning statement is 0320. After each succeeding
statement is entered, the statement number is automatically increased by 20, pro-
ducing statement numbers 0340, 0360, 0380, and so on.
AUTO 320,20 (then press EXECUTE)
\

Advertisement

Table of Contents
loading

Table of Contents