HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

5- 42
Parameters
S
$ A string expression to be evaluated. If
S
$ does not
start with a legal integer or real number, an error
occurs.
Examples
10 A = VAL("12ABC") !A = 12
20 B = VAL("3.45pq") !B = 3.45
20 C = VAL("9.00") !C = 9.00
VAL$
The VAL$ function returns the string formed by enclosing a number in
quotes.
Syntax
VAL$(
N
)
Parameters
N
A numeric expression that is to be evaluated. This can
be of any numeric type.
Examples
10 A$ = VAL$(12) !A$ = "12"
20 B$ = VAL$(3.45) !B$ = "3.45"
VERSION$
The VERSION$ function returns a string indicating the current version of
HP Business BASIC/XL. The string has the form V.bb.ff (V=Version,
bb=build, ff=fix).
Syntax
VERSION$
Examples
10 A$ = VERSION$ !A$ = A.00.00
WORD
The WORD function returns the position of an embedded substring within a
string. The substring is considered embedded only if the characters
surround the substring are nonalphabetic.
Syntax
WORD(
S1
$,
S2
$)
Parameters
S1
$ A string expression containing the string to be
searched.
S2
$ A string expression containing the substring to be found
in
S1
$.
Examples
10 A = WORD("cat","a") !A = 0
20 B = WORD("a cat","a") !B = 1
30 C = WORD("c a t","a") !C = 3