SPL to HP C/XL Migration Guide (30231-90001)
8- 10
|7.
array-id
(*) =
register sign offset
||
||=&
array-ref "
[
" index "
]
"
;|
| 8a.
array-id
(*) =
ref-id
||
|| |
| 8b.
array-id
(*) =
ref-id sign offset
|
init
:|
||=
"
{
" value
[,...]
"
}
"
|
|9.
array-id
(*) =
ref-id
(
index
)| |
|| |
||
index
:|
|
constant-array-decl
: | Cell number in
array-ref
of cell that |
| | corresponds to cell zero in SPL array. |
| 10.
array-id
(
lower
:
upper
)=PB | |
| |______________________ |
|:=
value-group
[,...] | |
|| |
| | The other SPL forms establish an |
|
value-group
: | equivalence relative to other declared data |
| | (not just arrays). Depending on their |
|{
initial-value
| actual use, they may be converted to HP |
|
repeat-factor
(
initial-value
[,...] )}| C/XL pointer or union types, or #define |
| | directives. If their relationships are |
| | fairly simple, pointers can be used. |
|| |
---------------------------------------------------------------------------------------------
|| |
| Default type: LOGICAL | Default type: int (= long int) |
|| |
---------------------------------------------------------------------------------------------
The general rules for global array declarations also apply to local ar-
ray declarations. See "ARRAY Declaration" for details and other con-
version suggestions.
Standard arrays declared local to a procedure are allocated each time
the procedure is called, and may not be referenced outside of the pro-
cedure.
Standard arrays (except for form 10) cannot be initialized.
Array form 10 is a special constant array declaration that is stored in
the code segment and cannot be modified while the program is running.
The suggested conversion to a static array (equivalent to an OWN array)
should be effective. Care must be taken with subsequent code changes,
since the converted static array can be modified by the program.
Summary of SPL Local Array Forms.
1a. Indirect; bounded; variable is pointer to cell zero; pointer in
next Q-relative location; pointer IS allocated; array begins in
next Q+ location; array IS allocated.
1b. Direct; bounded; variable is cell zero;
lower
in next Q+ location;
array IS allocated.
2. Indirect; variable bounds; variable is pointer to cell zero;
pointer IS allocated when procedure is called; array IS allocated
when procedure is called.
3. Indirect; unbounded; variable is pointer to cell zero; pointer in
next Q-relative location; pointer NOT allocated; array NOT
allocated.