Program and Subprogram Structure [ SPL to HP C/XL Migration Guide ] MPE/iX 5.0 Documentation
SPL to HP C/XL Migration Guide
Program and Subprogram Structure
Table 2-5. Program and Subprogram Structure
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| An SPL program consists of a single | An HP C/XL program consists of declarations |
| BEGIN-END block that contains global | and function definitions. The "main body" |
| declarations, procedures (which may include | of a program is a function named main. |
| subroutines), and a main body of | Functions may have local data declarations. |
| statements. Procedures may have local data | Functions cannot contain subroutines. |
| declarations; subroutines cannot. | |
| | |
---------------------------------------------------------------------------------------------
| | |
| A subprogram has the same structure as a | A "subprogram" compilation unit has the |
| main program, except that the block is | same structure as a main program, except |
| preceded by the compiler command $CONTROL | that it has no main function. |
| SUBPROGRAM and it has no main body. Outer | |
| blocks of subprograms are not compiled. | |
| | |
---------------------------------------------------------------------------------------------
In general, SPL procedures convert directly to HP C/XL functions.
MPE/iX 5.0 Documentation