4-131
Detailed specifications of MELFA-BASIC V
4MELFA-BASIC IV
4.3.8 Data type
In MELFA BASIC
Ⅴ
it is possible to use four data types: numerical values, positions, joints, and character
strings. Each of these is called a "data type." The numerical value data type is further classified into real
numbers and integers. There can be variables and constants of each data type.
Example)
Numeric value type M1 [Numeric value variables],1 [Numeric value constants] (Integer),
1.5 [Numeric value constants](Real number)
Position type
P1 [Position variables], (0,0,0,0,0,0) (0,0) [Position constants]
Joint type
J1 [Joint variables], (0,0,0,0,0,0) [Joint constants]
Character type
C1$ [Character string variables], "ABC" [Character string constants]
4.3.9 Constants
The constant types include the numeric value constant, character string constant, position constant, joint
constant and angle constant.
4.3.10 Numeric value constants
The syntax for numeric value constants is as follows. Numerical constants have the following characteris-
tics.
(1) Decimal number
Example) 1, 1.7, -10.5, +1.2E+5 (Exponential notation)
Valid range -1.7976931348308 to 1.7976931348308
(2) Hexadecimal number
Example) &H0001, &HFFFF
Valid range &H0000 to &HFFFF
(3) Binary number
Example) &B0010, &B1111
Valid range &B0000000000000000 to &B1111111111111111
(4) Types of constant
The types of constants are specified by putting symbols after constant characters.
Example) 10% (Integer), 1.0005! (Single-precision real number), 10.000000003# (Double-precision real
number)
4.3.11 Character string constants
String constants are strings of characters enclosed by double quotation marks (").
Example) "ABCDEFGHIJKLMN" "123"
Data type
Position type
Joint type
Character type
Real number type
Integer type
Numeric value type
Constants
Numeric value constants
Character string constants
Position constants
Joint constants
Angle constants
Up to 127 characters for character string
The character string can have up to 127 characters, including the step No. and double quotations.
Enter two double quotation marks successively in order to include the double quotation mark itself in a
character string. For the character string AB"CD, input "AB""CD".