Commodore 128 System Manual page 353

Hide thumbs Also See for 128:
Table of Contents

Advertisement

VARIABLES
The Commodore 128 uses three types of variables in BASIC.
These are: normal numeric, integer numeric and string
(alphanumeric).
Normal NUMERIC VARIABLES, also called floating point
variables, can have any exponent value from -10 to +10, with up
to nine digits of accuracy. When a number becomes larger than
nine digits can show, the computer displays it in scientific
notation form, with the number normalized to one digit and eight
decimal places, followed by the letter E and the power of 10 by
which the number is multiplied. For example, the number
12345678901 is displayed as 1.23456789E+10.
INTEGER VARIABLES can be used when the number is from
+32767 to -32768, and with no fractional portion. An integer
variable is a number like 5,10 or -100. Integers take up less
space than floating point variables, particularly when used in an
array.
STRING VARIABLES are those used for character data, which
may contain numbers, letters and any other characters the
Commodore 128 can display. An example of a string variable is
" COMMODORE 128" .
VARIABLE NAMES may consist of a single letter, a letter followed
by a number, or two letters. Variable names may be longer than
two characters, but only the first two are significant. An integer is
specified by using the percent sign (%) after the variable name.
String variables have a dollar sign ($) after their names.
EXAMPLES:
Numeric Variable Names: A, A5, BZ
Integer Variable Names: A%, A5%, BZ%
String Variable Names: A$, A5$, BZ$
ARRAYS are lists of variables with the same name, using an extra
number (or numbers) to specify an element of the array. Arrays
are defined using the DIM statement and may be floating point,
integer or string variable arrays. The array variable name is
followed by a set of parentheses () enclosing the number of the
variable in the list.
19-3

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents