HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 18
Parameters
str_expr
Its value must be an executable statement with 500 or
fewer characters. If it is not, an error occurs.
The executable statement cannot be any of the following:
* A command-only statement (for example, LIST).
* A program-only statement (for example, INPUT).
* The COMMAND statement.
* Any statement that defines a construct (for example:
WHILE, END WHILE, or REPEAT).
The statement cannot be a declaration statement, because
declaration statements are not executable.
Examples
100 READ I
105 DATA 1
110 IF I THEN
120 Routine$="Routine1"
130 ELSE
140 Routine$="Routine2"
150 ENDIF
160 COMMAND "GOSUB " + Routine$ !Issue the GOSUB statement
170 STOP
180 Routine1: I=I+(2*I)+(3*I)
190 RETURN
200 Routine2: I=I*(2+I)*(3+I)
210 RETURN
220 END
The COMMAND statement is not compilable.
CONVERT
This statement converts a string into a number, with an option for
specifying a line number or label to branch to if an error occurs.
Similar to the VAL function, the CONVERT statement translates a string of
ASCII characters into a numeric value that is assigned to a supplied
numeric variable. Unlike VAL, the CONVERT statement converts the numeric
value to the type of the numeric variable supplied. If a line label or
number is supplied and an error occurs, CONVERT branches to the
designated line without requiring an ON ERROR statement.
Syntax
{TO} [{,} ]
CONVERT
str_expr
{, }
num_var
[{;}
line_ref
]
{; }
Parameters
Str_expr
A string, substring, or other string expression.
The string representation is CONVERTed using the
following syntax:
['+']
[space]...['-']
num_char
[
num_char
]...['.']
[{'e'}['+'] ]
[
num_char
]...[{'l'}['-']
num_char
[
num_char
]...]
[{'d'} ]
num_char
is a numeric character in the range [0, 9]. If
a syntax error occurs before conversion of the first
numeric character, error 32 is generated if
line_ref
is
not supplied. Once the first numeric character has been
converted, if a syntax error occurs, then the value