SPL to HP C/XL Migration Guide (30231-90001)
8- 8
| 3b.
variable-id
=
ref-id sign offset
| |
| | |
---------------------------------------------------------------------------------------------
| | |
|
type
is required. | Default type: int (= long int) |
| | |
---------------------------------------------------------------------------------------------
| | |
| Storage is allocated each time the procedure| Same as SPL. |
| is called. If an initial value is defined, | |
| it will be assigned each time the procedure | |
| is called. | |
| | |
---------------------------------------------------------------------------------------------
Simple variables in forms 2 and 3 are usually various types of data
equivalences. They may be converted to pointers or union equivalences,
depending on the requirements of the program. See "ARRAY Declaration"
for further examples.
OWN Simple Variables.
Table 8-10. OWN Local Simple Variables
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
|
own-simple-variable-declaration
: |
static-simple-variable-declaration
: |
| | |
| OWN
type variable-decl
[,...] ; | static [
type
]
variable-decl
[,...] ; |
| | |
---------------------------------------------------------------------------------------------
| | |
|
variable-decl
: |
variable-decl
: |
| | |
| 1a.
variable-id
| 1a.
variable-id
|
| | |
| 1b.
variable-id
:=
initial-value
| 1b.
variable-id
=
initial-value
|
| | |
---------------------------------------------------------------------------------------------
| | |
|
type
is required. | Default type: int (= long int) |
| | |
---------------------------------------------------------------------------------------------
| | |
| An OWN local variable is allocated storage | Similar to SPL, using a static local |
| global to the procedure, in the DB-relative | variable. |
| area. It retains its values between | |
| successive calls to the procedure. | |
| | |
| If an initial value is declared for an OWN | |
| variable, the variable is initialized once, | |
| at the start of the program, not every time | |
| the procedure is called. | |
| | |
---------------------------------------------------------------------------------------------