SPL to HP C/XL Migration Guide (30231-90001)

5- 22
such as these is discouraged, as the resulting HP C/XL code will lack
portability and be more difficult to maintain.
Numeric Conversion. Unless a logical expression used in a condition
clause results in true or false values that are not 65535 or 0
respectively, or a relational (true/false) result is used in a bitwise
or numeric operation (not a recommended coding practice), there should
be no problem with a simple substitution of operator symbols.
In other words, if a test for true or false is not really a test for odd
or even, and if the values true and false are not used as numbers, the
results should be the same.
Converting a Range Test. The conversion of a range test, such as
X <= Y <= Z
may be performed in two steps.
(The example is true if X is less than or equal to Y, AND Y is less than
or equal to Z.)
Step 1: In SPL, change the expression to two "<=" tests joined with
LAND, for example:
(X) <= (Y) LAND (Y) <= (Z)
The parentheses may be needed to ensure the correct evaluation of the
expressions.
Step 2: In HP C/XL, replace LAND with either "&" or "&&":
(X) <= (Y) & (Y) <= (Z)
(X) <= (Y) && (Y) <= (Z)
The "&" bitwise AND is the "precise" conversion operator, but the "&&"
Boolean AND operator (described in "Condition Clauses" in this chapter)
is more efficient.
Other Notes. Note that the SPL test for equality "=" is the assignment
operator in HP C/XL. Failure to convert an SPL "=" to an HP C/XL "=="
will result in a statement which compiles without error, but which
performs a very different operation at runtime.
SPL uses relational operators to compare byte strings. See "Comparing
Byte Strings" below for an explanation and examples.