An Outline Of Basic - Sharp MZ-700 Series Owner's Manual

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

Advertisement

2.2 An Outline of BASIC
2.2.1 Constants
A constant is a number or string of characters which is written into a program, and which is used by
that program as it is executed. Types of constants include numeric constants, string (character) constants,
and system constants. These are explained below.
Numeric constants
A numeric constant is a number which has a maximum of 8 significant digits. The exponent of such
constants must be in the range from 10"
3 8
to 10
38
(the maximum range is 1.548437E-38 to 1.7014118E
+38).
(Examples:)
- 1 2 3 .
4
0 .
7 8 9
3 7 4 8 .
0
3 . 7 E + 1 2
3 . 7X10
1 2
1
7 . 6 5 E - 9
7 . 6 5 X 1 0 "
9
E indicates the exponent.
1 4 . 8 E 9
1 4 . 8 X 1 0
9
J
Hexadecimal numbers: Numbers can be specified in hexadecimal format only for direct memory
addressing with the LIMIT, POKE, PEEK, and USR instructions (see pages 92 and 93), and are repre-
sented as four digits preceded by a dollar sign ($).
(Examples:)
L I M I T
S B F F F
U S R C S C 0 0 0 ,
X S )
X$ represents a string variable.
String constants
String constants are letters and symbols between quotation marks which are included in programs to
allow titles or messages to be output to the display screen or printer. The characters " 4+9" appearing on
page 17 are a character constant, and not a numeric constant. With BASIC, a string constant may consist
of a maximum of 255 characters. (Not including quotation marks which cannot be included in a string
constant.)
. (Examples:)
1 1
A B C D E F G
1 1
1 1
1 2 3 4 5 6 7 8 9 1 0 "
D A T A
A B C D E F G
Quotation marks are not needed when string constants are
specified in a DATA statement; however, they may be used
if desired.
21

Advertisement

Table of Contents
loading

Table of Contents