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

5-5
| ARRAYNAME(0) and NEWARRAY(0) both refer to | |
| the same location. | |
| | |
---------------------------------------------------------------------------------------------
| | |
| All SPL addresses are 16-bit quantities | All HP C/XL addresses are 32-bit |
| that may be stored in integer and logical | quantities. |
| variables. It is preferable to store | |
| addresses in pointer variables, but the | In many cases, the SPL logical arrays may |
| lack of pointer "arrays" in SPL has led to | be converted to HP C/XL pointer arrays |
| some applications that store addresses in | without difficulty. |
| logical arrays. | |
| | |
---------------------------------------------------------------------------------------------
Table 5-7 compares various uses of the SPL "@" operator and the
equivalent HP C/XL assignment.
Table 5-7. Assignments Using Pointers and Simple Variables
---------------------------------------------------------------------------------------------
||||
| SPL | HP C/XL | Operation |
||||
---------------------------------------------------------------------------------------------
||||
| POINTER P1,P2; | unsigned int *P1,*P2; | Declarations |
||||
| LOGICAL V3; | unsigned int V3; | |
||||
---------------------------------------------------------------------------------------------
||||
| P1 := P2 | *P1 = *P2 | Object of P2 stored in |
| | | object of P1 |
||||
| P1 := @P2 | *P1 = P2 | Address in P2 stored in |
| | | object of P1 |
||||
| @P1 := @P2 | P1 = P2 | Address in P2 stored in P1 |
||||
| @P1 := P2 | P1 = *P2 | Object of P2 stored in P1 |
||||
---------------------------------------------------------------------------------------------
||||
| P1 := V3 | *P1 = V3 | Value of V3 stored in object |
|||ofP1|
||||
| P1 := @V3 | *P1 = &V3 | Address of V3 stored in |
| | | object of P1 |
||||
| @P1 := @V3 | P1 = &V3 | Address of V3 stored in P1 |
||||
| @P1 := V3 | P1 = V3 | Value of V3 stored in P1 |
||||
---------------------------------------------------------------------------------------------
||||
| V3 := P2 | V3 = *P2 | Object of P2 stored in V3 |
||||
| V3 := @P2 | V3 = P2 | Address in P2 stored in V3 |
||||
---------------------------------------------------------------------------------------------