SPL to HP C/XL Migration Guide (30231-90001)
8- 16
| | Remove the SPL label declarations. |
| | |
---------------------------------------------------------------------------------------------
| | |
| The scope of a local label is the | Same as SPL. |
| procedure. | |
| | |
---------------------------------------------------------------------------------------------
Local SWITCH Declarations
See "SWITCH Declaration" for further details.
Table 8-19. Local 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
; \ |
| | |
| | [...] |
| | |
| |
"
}
"
|
| | |
| | ... |
| | |
| | #undef
switch-id
|
| | |
---------------------------------------------------------------------------------------------
| | |
|
switch-reference
: |
define-reference
: |
| | |
| GOTO
switch-id
(
index
) |
switch-id
(
index
) |
| | |
---------------------------------------------------------------------------------------------
| | |
| The scope of a local SWITCH declaration is | The scope of a #define directive is not |
| the procedure. | local. It is known to all following source |
| | code. To turn it off, insert the #undef |
| | directive at the end of the function. |
| | |
---------------------------------------------------------------------------------------------
Local ENTRY Declaration
Table 8-20. Local ENTRY Declaration
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
|
entry-declaration
: | No direct equivalent. |
| | |
| ENTRY
label-id
[,...] ; | |
| | |
---------------------------------------------------------------------------------------------