HP 3000 Manuals

Procedures [ SPL to HP C/XL Migration Guide ] MPE/iX 5.0 Documentation


SPL to HP C/XL Migration Guide

Procedures 

          Table 2-7.  Procedures 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|                     SPL                     |             HP C/XL Equivalent              |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| An SPL procedure can be passed parameters,  | An HP C/XL function can be passed           |
| either by reference or by value.            | parameters, but always by value.            |
|                                             |                                             |
|                                             | Pass-by-reference is emulated by explicitly |
|                                             | passing an address pointer and              |
|                                             | dereferencing that pointer within the       |
|                                             | function.  (Array identifiers appear to be  |
|                                             | passed by reference; they are passed as     |
|                                             | pointers.)                                  |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| Can declare local variables and reference   | Same as SPL.                                |
| global variables.                           |                                             |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| Can return a value.                         | Same as SPL.                                |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| Can call themselves.                        | Same as SPL.                                |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| Can be called from other procedures and     | Can be called from other functions and from |
| from the main block.                        | the main function.                          |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| Can contain local subroutines.              | Cannot contain nested functions.  The       |
|                                             | closest HP C/XL equivalent is the #define   |
|                                             | macro directive (see "Subroutines" below).  |
|                                             |                                             |
---------------------------------------------------------------------------------------------



MPE/iX 5.0 Documentation