HTBasic Help
×
Menu
Index

Numeric Items

 
A number builder is used with numeric items to change ASCII data to numeric data for assignment to a numeric variable. Leading non-numeric characters are ignored. Blanks are ignored where ever they occur. The number is expected to be in the form:
 
[sign] mantissa [E exponent] item-terminator
 
Where:
 
sign = + | -
mantissa = [digits] [.] [digits]
exponent = [sign] digits
 
The mantissa must have at least one numeric digit, whether it be before or after a decimal point. Because REAL numbers have only fifteen digits of precision, any mantissa digits after the 15th digit are considered to be "0". The "E" before the exponent can be either upper or lower case. The item-terminator is any non-numeric character. The item-terminator can either be an EOI on the last character of the number, or any non-numeric character. The entire ENTER statement must also be properly terminated.
 
DIM A$[30]
A$="hello + 1 2 3 goodbye"&CHR$(13)&CHR$(10)
ENTER A$;X,B$
 
This example will assign 123 to X and "oodbye" to B$. The "g" was used to terminate X and thus is not present in B$.
 
A complex item is entered in rectangular form, real part first, followed by the imaginary part. The rules for each part are the same as the rules for numeric items given above.