Automatic Statement Numbering; Sample Run - IBM 5110 Basic Introduction

Table of Contents

Advertisement

The numbers preceding the statements are called statement numbers.
They are necessary so the system knows the proper sequence of your
instructions. BASIC statement numbers in the 5110 can have values
from 0001 through 9999. You can use consecutive numbers if you
wish, but normally you should leave room for expansion between the
statement numbers so that changes can be made more easily (see
Making Changes to Your Program). When you enter statement
numbers, you do not need to include the leading zeros. They will be
added by the system when the statement is entered.
After you have computed your last savings calculation, you can end
the program operation by entering 0 for the requested principal and
pressing EXECUTE.
Automatic Statement Numbering
Instead of manually entering the statement numbers in a BASIC
program, you can instruct the system to provide statement numbers
for you. You can do this with the AUTO command. Simply enter
AUTO and press EXECUTE. Notice that the word AUTO is displayed
above statement number 0010. From this point on, the system
numbers your statements in increments of 10. Automatic numbering
continues until you enter anything other than an AUTO-numbered
BASIC statement (a command word, for example, LIST) in the input
line. You can res\ore automatic numbering by entering AUTO NNNN,
where NNNN is the statement number you want to begin with.
Sample Run
Let's use the accumulated savings program to calculate the amount of
savings generated by an investment of $1000 for 10 years at a rate of
5%.
Note the Comma to
Separate the Variables
You Enter
PtJN
Number of Years
=
10
System Requests Input- I N:I: T:I:
(l'u,
Initial Principal
=
$1000---:1. 0 0 0
System Requests input-INT'"PE::;T
r:
t :,
fE';)
!
Nl.jhI-:n:::F:
CJF
YTt1F<::::;";)
Interest Rate
=
5
~,::,;!
10
The Answer
(,CCl.jf'iLIL(.~',TED
:3t',VINU:;::;
(,FTEP
:I.
0
Syste m Requests New-
J
(~
I
'r
I
(l
L P
I~
J
(\1
C:
I P
(:11... ';)
Principal
, _
II
You Enter to End ______
u
Prog~m
READY
System Indicates it is
~
Ready to Proceed
38
We'll Call This
$1628.89
/ ; / '
: 1 ,
X><X:X><
Cursor
Amount of Storage
Position
Available
()
,{'
"1\
"~_l
()
The numbers preceding the statements are called statement numbers.
They are necessary so the system knows the proper sequence of your
instructions. BASIC statement numbers in the 5110 can have values
from 0001 through 9999. You can use consecutive numbers if you
wish, but normally you should leave room for expansion between the
statement numbers so that changes can be made more easily (see
Making Changes to Your Program). When you enter statement
numbers, you do not need to include the leading zeros. They will be
added by the system when the statement is entered.
After you have computed your last savings calculation, you can end
the program operation by entering 0 for the requested principal and
pressing EXECUTE.
Automatic Statement Numbering
Instead of manually entering the statement numbers in a BASIC
program, you can instruct the system to provide statement numbers
for you. You can do this with the AUTO command. Simply enter
AUTO and press EXECUTE. Notice that the word AUTO is displayed
above statement number 0010. From this point on, the system
numbers your statements in increments of 10. Automatic numbering
continues until you enter anything other than an AUTO-numbered
BASIC statement (a command word, for example, LIST) in the input
line. You can res\ore automatic numbering by entering AUTO NNNN,
where NNNN is the statement number you want to begin with.
Sample Run
Let's use the accumulated savings program to calculate the amount of
savings generated by an investment of $1000 for 10 years at a rate of
5%.
Note the Comma to
Separate the Variables
You Enter
PtJN
Number of Years
=
10
System Requests Input- I N:I: T:I:
(l'u,
Initial Principal
=
$1000---:1. 0 0 0
System Requests input-INT'"PE::;T
r:
t :,
fE';)
!
Nl.jhI-:n:::F:
CJF
YTt1F<::::;";)
Interest Rate
=
5
~,::,;!
10
The Answer
(,CCl.jf'iLIL(.~',TED
:3t',VINU:;::;
(,FTEP
:I.
0
Syste m Requests New-
J
(~
I
'r
I
(l
L P
I~
J
(\1
C:
I P
(:11... ';)
Principal
, _
II
You Enter to End ______
u
Prog~m
READY
System Indicates it is
~
Ready to Proceed
38
We'll Call This
$1628.89
/ ; / '
: 1 ,
X><X:X><
Cursor
Amount of Storage
Position
Available
()
,{'
"1\
"~_l
()

Advertisement

Table of Contents
loading

Table of Contents