HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

2-: 27
! FileA
10 PRINT "Program A"
20 CALL A_sub
30 PRINT "End of Program A"
40 PRINT "Program B"
50 CALL B_sub
60 PRINT "End of Program B"
70 STOP
130 SUB B_sub
140 PRINT "In subprogram B_sub"
150 SUBEND
>
Example 2
The following example shows the effect of a programmatic GET of an ASCII
file. Because the GET specifies line 120, Program A is left intact, and
Program B becomes part of A_sub.
>GET "Filea"
>LIST
! Filea
10 PRINT "Program A"
20 CALL A_sub
30 PRINT "End of Program A"
40 STOP
100 SUB A_sub
110 PRINT "In subprogram A_sub"
120 SUBEND
>15 GET "Fileb",120;20 !First line of Fileb is 120, execution &
skips to 20
>16 PRINT "This line should be skipped."
>LIST
! Filea
10 PRINT "Program A"
15 GET "Fileb", 120;20 !First line of Fileb is 120, execution skips to 20
16 PRINT "This line should be skipped."
20 CALL A_sub
30 PRINT "End of Program A"
40 STOP
100 SUB A_sub
110 PRINT "In subprogram A_sub"
120 SUBEND
>RUN
Program A
In subprogram A_sub
Program B
In subprogram B_sub
End of Program B
>LIST
! Filea
10 PRINT "Program A"
15 GET "Fileb", 120;20 !First line of Fileb is 120, execution skips to 20
16 PRINT "This line should be skipped."
20 CALL A_sub
30 PRINT "End of Program A"
40 STOP
100 SUB A_sub
110 PRINT "In subprogram A_sub"
120 PRINT "Program B"
130 CALL B_sub
140 PRINT "End of Program B"
150 STOP
210 SUB B_sub
220 PRINT "In subprogram B_sub"
230 SUBEND