Radio Shack CTR-118 User Manual Page 16

  • Download
  • Add to my manuals
  • Print
  • Page
    / 196
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 15
1-4
Variable Names
Variable names must begin with a letter (A-Z) and may be followed by
another letter or digit (0-9). So the following are all valid and distinct
variable names:
AZZ Z1 A2 AA AZ G9 GP M MU
Variable names may be longer than two characters, but only the first two
characters will be used by the computer to distinguish between variables. For
example "SUM", "SUB" and "SU" will be treated as one and tile same
variable by LEVEL II BASIC.
As you can imagine, this gives you plenty of variable names to use in LEVEL
II (in the neighborhood of 900).
However, you cannot use variable
names, which contain words with special meaning in the BASIC
language.
For example, "XON" cannot be used as a variable name, since it
contains the BASIC keyword "ON". The complete list of "reserved words"
which cannot be used in variable names appears in Appendix A of this
Manual.
Variable Types
There are four types of variables in LEVEL II: integer, single precision,
double precision, and string variables. The first three types are used to store
numerical values with various degrees of precision; the last type stores
strings (sequences) of characters - letters, blanks, numbers and special
symbols - up to 255 characters long. LEVEL I only allowed two string
variables, A$ and B$ -but LEVEL II allows you to use any variable name for
strings, simply by adding the string declaration character, $, to the variable
name. There are declaration characters for the other variable types, too:
Here's a complete listing:
Variable Type
Declaration
Character Examples Typical values stored
integer (whole
numbers from -32768
to +32767)
% A%, B9% -30, 123, 3, 5001
single precision
(6 significant figures)
! or E A!, AA!, Z1! 1, -50, .123456,
353421, 1.23E-5
double precision
(16 significant
figures)
# A#, ZZ#, C#
-300.12345678
3.141592653589
1.000000000000001
double precision with
scientific notation (for
entering constants or
during output of large
or small numbers)
D "A#=1.2345678901D+12" 1.2345678901 x 1012
string (up to 255
characters)
$ A1$, GT$, HI$ "JOHN Q. DOE",
"WHISTLE-STOP"
"1+2=?"
Page view 15
1 2 ... 11 12 13 14 15 16 17 18 19 20 21 ... 195 196

Comments to this Manuals

No comments