SPL to HP C/XL Migration Guide (30231-90001)
8-: 19
| | The
user-id
option allows you to rename the |
||
intrinsic-id
for references in your |
| | compilation unit. |
|||
---------------------------------------------------------------------------------------------
Table 8-25. INTRINSIC Declaration Examples
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| | |
| INTRINSIC FREADDIR; | #pragma intrinsic FREADDIR |
| | #pragma intrinsic_file "MYINTRS" |
| INTRINSIC (MYINTRS) MYFREAD; | #pragma intrinsic MYFREAD |
| | #pragma intrinsic_file "" |
| | |
---------------------------------------------------------------------------------------------
| | |
| The first declaration seeks the intrinsic | The first pragma directive seeks the |
| FREADDIR in the system intrinsic library. | intrinsic FREADDIR in the system intrinsic |
| The second seeks MYFREAD in the user | library SYSINTR.PUB.SYS. The second |
| library named MYINTRS. | redirects subsequent searches to the user |
| | intrinsic file named MYINTRS. The third |
| | seeks the intrinsic MYFREAD in MYINTRS. The |
| | fourth resets the search to the system file |
| | SYSINTR.PUB.SYS. |
| | |
---------------------------------------------------------------------------------------------
The HP C/XL pragmas are described further in the
HP C/XL Reference Manual
Supplement
. The construction of user intrinsic files is discussed in
the
HP Pascal Programmer's Guide
.
SUBROUTINE Declaration
Table 8-26. SUBROUTINE Declaration
---------------------------------------------------------------------------------------------
|| |
| SPL | HP C/XL Equivalent |
|| |
---------------------------------------------------------------------------------------------
|| |
|
subroutine-declaration
: | Global.
function-definition
:|
|| |
|1.[
type
] SUBROUTINE
subroutine-id
| 1. static [
type
|
| | void]
function-id
|
||(
formal-parm
[,...] ) |
| [VALUE
formal-parm
[,...] ] | |
||
formal-parm-decl
[;...] ; |
|
formal-parm-decl
[;...] ; | |
||
"
{
" statement "
}
"
|
|
statement
;| |
| | 2. static [
type
|
|2.[
type
] SUBROUTINE
subroutine-id
| void]
function-id
() |
|| |
|
statement
;|
"
{
" statement "
}
"
|
|| |
|| |
|
statement
| Local.
define-directive
:|
| may be any SPL statement, including | |
| compound (BEGIN-END). | 1. #define
function-id
(|
|| |
||
formal-parm
[,...] ) |
|| |
||
statement-process
|
|| |