HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
9- 13
| | program accesses a variable before assigning a value to it, no error |
| | occurs, but the value of the variable is indeterminate. |
| | |
---------------------------------------------------------------------------------------------
| | |
| MAIN | Defines this as the main program of a multi-program application. |
| | Outer block is generated. |
| | |
---------------------------------------------------------------------------------------------
| | |
| SUBPROGRAM | Identifies this program as a module of a multi-program application. |
| | Code is produced for the main subunit, but no outer block is |
| | generated. |
| | |
---------------------------------------------------------------------------------------------
| | |
| NEWCOM | The compiled main subunit deallocates undefined COM blocks when |
| | called, and allocates new defined commons. |
| | |
---------------------------------------------------------------------------------------------
| | |
| NO NEWCOM | The compiler only generates code to check common name and sizes. |
| | Commons are not allocated or deallocated. When used with option |
| NONEWCOM | MAIN, code for initial allocation goes in the outer block instead of |
| | the code for the main subunit. |
| | |
---------------------------------------------------------------------------------------------
The defaults are: REAL, BASE 0, INIT, MAIN, NEWCOM
Examples
10 GLOBAL COPTION LABEL TABLES, ID TABLES
20 INTEGER I
30 DIM Deck(52), Suit$(4)[8], Ranks$(13)[6]
35 TRACE VARS Deck
40 COPTION TITLE="Start of initialization", PAGE
50 Suit$(1)="spades"
:
200 COPTION NORANGE CHECKING
210 FOR I=1 TO 62
220 Deck(I)=I
230 NEXT I
:
1000 DEF FNPrint$(INTEGER Row, Col, S$)
1010 COPTION TITLESUB="Function FNPrint",PAGESUB,NOWARN,NOLABEL TABLES
1015 PAUSE
1020 Move_to(Row, Col)
1030 RETURN S$
1090 FNEND
1095 !***** Subprogram to move the cursor.
2000 SUB Move_to (INTEGER Row, Col)
2005 COPTION TITLESUB="Subprogram Move_to", PAGESUB
2010 PRINT '27"&a";VAL$(Row);"r";VAL$(Col);"C";
2020 SUBEND
The compiler listing for the above program is:
PAGE 1 HP Business BASIC/XL Compiler HP32115B.00.00 (c) Hewlett-Packard
1985-1987 TUE, AUG 25, 1987, 11:19 AM
10 GLOBAL COPTION LABEL TABLES, ID TABLES
20 INTEGER I
30 DIM Deck(52), Suit$(4)[8], Ranks$(13)[6]
35 TRACE VARS Deck
WARNING 2050: TRACE or PAUSE statement found and ignored.
40 COPTION TITLE="Start of initialization", PAGE
PAGE 2 Start of initialization