Sharp MZ-700 Series Owner's Manual page 24

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

2.2.2 Variables
The word "variable" has a different meaning with BASIC than it does when used with regard to alge-
braic expressions. To put it in very simple terms, the variables of BASIC are " b o x e s " in memory f o r
the storage of numbers and characters (character strings). The types of variables used in BASIC include
numeric variables, string variables, and system variables.
System variables
Numeric variables
String variables
SIZE
Numeric variables
Only numeric data can be stored in numeric variables.
Names must be assigned to these variables in accordance with the following rules.
i)
A variable name may consist of any n u m b e r of characters, b u t only the first two characters are
actually used by the BASIC interpreter to identify the variable. Further, the first character of the
variable name must be a letter (A t o Z), either letters or numerals may be used for subsequent
characters.
ii) It is n o t possible to use the names of BASIC commands and statements as variable names.
Correct variable names:
ABC, XY, ABCD, A 1 2 3 4 5
(ABC and ABCD are regarded as the same variable.)
Incorrect variable names: PRINT
(PRINT is a BASIC statement)
C@
(Variable names may n o t include special charac-
ters.)
(Example:)
1 0
A = 5
Stores 5 in variable A.
2 0
P R I N T
A
Displays the value stored in variable A.
22

Advertisement

Table of Contents
loading

Table of Contents