HP 3000 Manuals

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


SPL to HP C/XL Migration Guide

Compound Statements 

          Table 2-10.  Compound Statements 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|                     SPL                     |             HP C/XL Equivalent              |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| compound-statement:                         | compound-statement:                         |
|                                             |                                             |
|      BEGIN [statement] [;...] [;] END       |      "{" [statement] [...] "}"              |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| Semicolons are not part of statements; they | Semicolons are part of statements; they are |
| are used to separate statements.            | required terminators.  "Extra" semicolons   |
|                                             | form null statements, similar to SPL.       |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| Example                                     | Example                                     |
|                                             |                                             |
|      BEGIN                                  |      {                                      |
|         A := 10 ;                           |       A = 10 ;                              |
|         B := 17  OR  B := 17 ;              |       B = 17 ;                              |
|      END                                    |      }                                      |
|                                             |                                             |
---------------------------------------------------------------------------------------------

In HP C/XL, a compound statement may be a block.  That is, it may contain
declarations for data that is local to itself.



MPE/iX 5.0 Documentation