SPL to HP C/XL Migration Guide (30231-90001)
8-: 7
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| standard | [auto] (the default case) |
| | |
---------------------------------------------------------------------------------------------
| | |
| OWN | static |
| | |
---------------------------------------------------------------------------------------------
| | |
| EXTERNAL | extern |
| | |
---------------------------------------------------------------------------------------------
OWN Variables
Table 8-8. OWN Variables
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| Standard variables declared local to a | Same as SPL, using auto variables (the |
| procedure are assigned new space each time | default). |
| a procedure is invoked, the space being | |
| released when the procedure is exited. | |
| | |
---------------------------------------------------------------------------------------------
| | |
| If a variable is declared as OWN, space is | Same as SPL, using static variables. |
| allocated outside of the dynamic scope of | |
| the procedure, in the DB-relative area. | |
| | |
| The variable is still known only to the | |
| procedure, and it retains its value between | |
| successive calls to the procedure. If an | |
| OWN variable is initialized, it is | |
| initialized once, at the start of the | |
| program, not every time the procedure is | |
| called. | |
| | |
---------------------------------------------------------------------------------------------
Local Simple Variable Declarations
Standard Local Variables.
Table 8-9. Standard Local Simple Variables
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
|
standard-local-simple-variable-declaration
: |
simple-variable-declaration
: |
|
type variable-decl
[,...] ; | [
type
]
variable-decl
[,...] ; |
| | |
---------------------------------------------------------------------------------------------
| | |
|
variable-decl
: |
variable-decl
: |
| 1a.
variable-id
| 1a.
variable-id
|
| 1b.
variable-id
:=
initial-value
| 1b.
variable-id
=
initial-value
|
| 2a.
variable-id
=
register
| |
| 2b.
variable-id
=
register sign offset
| |
| 3a.
variable-id
=
ref-id
| |