i
I
TRS-80
MODEL III
DEFINT
letter range
Variables
beginning with any
letter in the specified range will be stored and treated
as integers , unless a
type declaration character is
added
to
the variable name. This
lets you conserve memory,
since integer values take up less memory
than other
numeric
types.
And integer arithmetic is faster
than single or double precision
arithmetic.
However,
a
variable defined as integer
can only take on values between
-
32768 and +
32767 inclusive.
Examples:
10
DEFINTA, I, N
After line
10,
all
variables beginning with A, I or N
will be treated as integers. For
example, A
1,
AA, 13
and
NN
will be integer variables.
However,
A
1#,
AA#, I3#
would
still be double
precision variables, because of the type declaration
characters, which
always over-ride
DEF
statements.
10
DEFINT l-N
Causes variables beginning
with
I, J, K, L,
M or
N
to be treated as
integer
variables.
DEFINT may be
placed anywhere in a program ,
but it may change the meaning of
variable references without type declaration
characters. Therefore it is normally
placed
at
the beginning
of a
program.
DEFSNG letter range
Causes any variable beginning with
a letter
in the specified range to be stored and
treated
as
single
precision, unless a type declaration character is added. Single
precision variables
and constants are stored with 7 digits of precision and printed
out
with
6
digits
of precision. Since all numeric variables are assumed to be single
precision unless
DEFined otherwise, the DEFSNG statement is primarily used
to
re-define variables which
have previously been defined as double precision or
integer.
Example:
100
DEFSNG I,
W-Z
Causes variables beginning with the letter I or any letter W through Z
to
be treated
as single precision. However, 1% would still
be
an integer variable,
and I# a double
precision variable,
due to
the
use of type
declaration characters.
148