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

3- 32
Syntax
str_expr1
+
str_expr2
The resulting string is the value of
str_expr1
with the value of
str_expr2
appended to it. The length of the resulting string is the sum
of the two lengths.
Example
10 Mystery1$="hot"+"dog" !Mystery1$'s length is set to 6
20 Mystery2$="base"+"ball" !Mystery2$'s length is set to 8
30 PRINT Mystery1$+"s"+" and "+Mystery2$
40 ! Line 30 prints -- hotdogs and baseball
Evaluation of Expressions
HP Business BASIC/XL evaluates a simple (one operator) expression by
evaluating its operands or actual parameters from left to right, and
then performing the operation or function.
Examples
10 A=2
20 B=7
30 C=A+B
99 END
In line 30 of the above program, HP Business BASIC/XL evaluates A and B
(in that order) and then adds their values (2 and 7, respectively) to
produce the result, 9.
100 X=10
110 Y=15
120 Z=20
130 Max_xyz=MAX(X,Y,Z)
999 END
In line 130 of the above program, HP Business BASIC/XL evaluates the
expression MAX(X,Y,Z) by first evaluating X, Y, and Z (in that order) and
then comparing their values (10,15, and 20, respectively) and returning
the largest value (20).
More complex expressions can be constructed by substituting expressions
for the operands or parameters. For example, the expressions A+B and
MAX(X,Y,Z) are operands of the addition operator in the expression
(A+B)+MAX(X,Y,Z). HP Business BASIC/XL evaluates (A+B)+MAX(X,Y,Z) by
first evaluating A+B and MAX(X,Y,Z) (in that order) as explained above,
and then adding their values (nine and 20, respectively) to produce the
result, 29.
When an expression has expressions for operands or parameters, operator
hierarchy determines the order in which the component operations are
performed. The general rule of left to right expression evaluation
applies to the evaluation of each subexpression. For example, operator
hierarchy dictates that the expression 2*3+4*5 is evaluated as (2*3) +