EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 157

Radio Shack TRS-80 Model 4
418 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
Loading...
Variable
Names
In
BASIC, variables are represented by names. Variable names must
begin with a letter, A through
Z.
This letter may be followed by one
or
more characters (digits or letters).
For example:
AM
A
A1
BALANCE
EMPLOYEE2
are all valid and distinct variable names.
Variable names may be up to
40 characters long. All characters are
significant
in
BASIC.
Reserved
Words
Certain combinations of letters are reserved as BASIC keywords and
operator names. These combinations cannot be used as variable
names. For example:
OR LEN
OPTION
cannot be used as variable names. However, they may be embedded
in a variable name. For example,
OPTIONS
is a valid variable name.
TRSDOS
Version 6 requires that all reserved words be delimited. This
means that you must leave a blank space between a reserved word
and any variables, constants or other reserved words. See Appendix
F for a list of BASIC's reserved words.
Simple
and
Subscripted
Variables
Variables may also be "subscripted" so that an entire list of
data
can
be stored under one variable name. This method of data storage is
called an
array. For example, an array named A may contain these
elements (subscripted variables):
A(0)
A(1
)
A(2)
A(3) A(4)
You may use each of these elements to store a separate
data
item,
such as:
A(0) = 5.3
A(1)
= 7.2
A(2) = 8.3
A(3)
= 6.8
A(4)
= 3.7
In
this example, array A is a one-dimensional array, since each
element contains only one subscript. An array may also be
two-dimensional, with each element containing two subscripts. For
example, a two-dimensional array named X could contain these
elements:
2-29

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals