EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 163

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...
anyway, you would only need to use DEFSNG if one
of the other DEF statements was used).
For example:
DEFSTR
L
makes BASIC classify all variables which start with L as string
variables. After this statement, the variables:
L LP
LAST
can all hold string values only.
Type
Declaration
Tags
As with constants, you can always override the type of a variable
name by adding a type declaration tag at the end. The four types of
declaration tags for variables are:
% Integer
! Single precision
# Double precision
$ String
For example:
1%
FT%
NUM% COUNTER%
are all integer variables,
regardless of what attributes have been
assigned to the letters
I,
F,
N,
and
C.
T! RY! QUAN! PERCENT!
are all single-precision variables,
regardless of what attributes have
been assigned to the letters
T,
R,
Q,
and
P.
X#
RR#
PREV#
LSTNUM#
are all double-precision variables, regardless of what attributes have
been assigned to the letters
X,
R,
P,
and
L.
Q$ CA$ WRD$ ENTRY$
are all string variables,
regardless of what attributes have been
assigned to the letters
Q,
C,
W,
and
E.
Note that any given variable name can represent four different
variables. For example:
A5#
A5! A5%
A5$
are all valid and
distinct
variable names.
One further implication
of
type declaration: Any variable name
used without a tag is equivalent to the same variable name used with
one of the four tags. For example, after the statement:
2-35

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals