Radio Shack TRS-80 Model 100 Basic Manual page 104

Basic language lab
Hide thumbs Also See for TRS-80 Model 100:
Table of Contents

Advertisement

Experiment #5 Save the Data
The sales data from the previous experiment will be used again in later lessons. To
save yourself the time required to retype the data, you can simply save it as a RAM
file and merge it later.
Delete lines 10 through 190 from the Sales Trend program using the CUT function of
the Editor. Also, change the first digit of each of the remaining line numbers from 2
to 9.
List the remaining part of the program to confirm that it is:
800
DATA
160, 175, 140, 230
81Ql
DATA
155, 215. 155. 225
820
DATA
215, 265. 220, 325
830
DATA
225, 270, 265, 280
840
DATA
275, 350. 255, 345
850
DATA
300, 330. 315, 380
Since this data will be merged later, it must be saved as an ASCII file. Therefore,
enter the command:
SAVE "SALES" ,A
Go to the Menu. by pressing
tIIl
and confirm that file SALES.DO is listed. This file
will be used in the next Lesson.
What you have learned:
You should now be able to use the FOR / NEXT statements in your own programs to
repeat a group of statements. Using the STEP option with the FOR statement will
allow you to control the increment for the index variable in the FOR / NEXT loop.
You also learned that subscripted variables facilitate manipulation of data by storing it
in a block of locations called an array. You can put two or more statements on one
program line using the colon (:) delimiter to save time and perhaps conserve display
space. You saw how the CLS statement was used to clear the display before printing.
These new statements and concepts should prove very useful to you in writing your
own BASIC programs.
98

Advertisement

Table of Contents
loading

Table of Contents