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

4-12
SWITCH Declaration
Table 4-6. SWITCH Declaration
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
|
switch-declaration
: |
define-directive
: |
| | |
| SWITCH
switch-id
:=
label-id0
[,...] | #define
switch-id
(X) \ |
| | |
| | switch (X) \ |
| | |
| |
"
{
"
\ |
| | |
| | case 0: goto
label-id0
; \ |
| | |
| | case 1: goto
label-id1
; \ |
| | |
| | [...] |
| | |
| |
"
}
"
|
| | |
---------------------------------------------------------------------------------------------
| | |
| A switch declaration defines and names an | The corresponding transfer of control may |
| ordered list of labels that may be | be executed by specifying the defined macro |
| transferred to by an indexed GOTO statement | with the same
index
as in SPL: |
| in the form: | |
| |
switch-id
(
index
) |
| GOTO
switch-id
(
index
) | |
| | |
| See "GO TO Statement". | |
| | |
---------------------------------------------------------------------------------------------
ENTRY Declaration
Table 4-7. ENTRY Declaration
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
|
entry-declaration
: | No equivalent. |
| | |
| ENTRY
label-id
[,...] ; | |
| | |
---------------------------------------------------------------------------------------------
You may emulate multiple entry points into an SPL program by using the
argc, argv, parm, and info parameters of the HP C/XL main function, and
coding a switch statement to goto the appropriate labels. (See "SWITCH
Declaration" above for the format.) In HP C/XL, you may pass arguments
to these parameters with the INFO= and PARM= parameters of the MPE XL
:RUN command.