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

5- 4
| | Note: The HP C/XL assignment operator, |
| | "=", is the SPL equality operator. |
|| |
---------------------------------------------------------------------------------------------
|| |
| Indexes are enclosed in parentheses, "( )". | Indexes are enclosed in brackets, "[ ]". |
|| |
---------------------------------------------------------------------------------------------
SPL allows assignment to the array-id of an indirect array since it is
really a pointer. HP C/XL does not permit assignments to any array-id.
You may simulate the process by using a pointer to array cell zero. (See
"ARRAY Declaration".)
The reserved word TOS and the ABSOLUTE function cannot be translated
(see below). Their operations must be recoded entirely.
TOS
Table 5-5. TOS
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| TOS | No equivalent. |
| | |
---------------------------------------------------------------------------------------------
| | |
| Refers to the top of the hardware stack. | You could write routines to emulate the |
| | hardware stack, but a better solution is to |
| | recode SPL programs to eliminate stack |
| | references. |
| | |
---------------------------------------------------------------------------------------------
Addresses (@) and Pointers
Table 5-6. Addresses and Pointers
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| The address operator, "@", before a simple | The address operator, "&", before any |
| variable-id yields the address of the | variable-id yields the address of the |
| variable instead of its contents. If "@" | variable. Before a subscripted pointer-id |
| precedes an array or pointer reference, it | or array-id, it yields the address of the |
| yields the address of cell zero or of the | referenced location. |
| indexed location if indexed. | |
| | The dereference operator, "*", before a |
| If "@" precedes an unsubscripted pointer-id | pointer expression yields the value of the |
| or indirect array-id on the left side of | referenced location. An array-id can be |
| the assignment operator, ":=", the | used as a pointer in an expression. |
| right-side expression is stored as the new | |
| address value in the identifier. | An unsubscripted pointer-id or array-id |
| | yields the address in the identifier. |
| This leads to a potentially confusing | |
| feature of SPL: | |
| | |
| @ARRAYNAME := @NEWARRAY; | |
| | |
| This assigns the address of NEWARRAY(0) to | |
| array variable ARRAYNAME. Consequently, | |