EasyManuals Logo

Tandy 1000 Basic Reference Manual

Default Icon
411 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #62 background imageLoading...
Page #62 background image
Chapter
61 Arrays
This program creates a 1-dimensional array:
5
CLS:OPTION BASE 1
10 DATA GROCERY,GAS,CLOTHES
20 DIM
A(3)
30 FOR
C
=
1 TO
3
40 READ NAMES$
50 PRINT "ENTER THE "NAMES$" EXPENSE IN DOLLARS"
60 INPUT
A(C)
70 NEXT
C
The
DIM
statement in Line 10 reserves space in memory for an
array named
A
with 3 elements. As you enter the expenses, the
grocery expense
is
stored in A(l), the gas expense in A(2) and
the clothes expense in A(3).
Add these lines
to
the program
to
print the contents
of
Array A:
100 RESTORE
110 FOR
C
=
1 TO
3
120 READ NAMES$
130 PR1NT:PRINT NAMES$
"
=
"
A(C)
140 NEXT
C
Use RUN
to
see the results
of
this program.
You can add more dimensions
to
the array such as storing the
expenses by weeks.
Col
1
Col 2 Col
3
Grocery
Gas Clothes
Row
1
Week
1
Row
2
Week 2
Row
3
Week
3
Row
4
Week
4
A(3,2)
=
Gas expense
for Week
3
60

Table of Contents

Other manuals for Tandy 1000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tandy 1000 and is the answer not in the manual?

Tandy 1000 Specifications

General IconGeneral
ProcessorIntel 8088
Processor Speed4.77 MHz
RAM128 KB (expandable to 640 KB)
Operating SystemMS-DOS 2.11
ManufacturerTandy Corporation
Release Year1984
StorageSingle or double 5.25" floppy disk drive (360 KB), optional hard drive
SoundTandy 3-voice sound
PortsParallel, Serial
GraphicsCGA (Color Graphics Adapter)
Graphics Modes320x200, 640x200

Related product manuals