using_20data_20statements_20in_20libraries
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| using_20data_20statements_20in_20libraries [2018/03/31 13:19] – external edit 127.0.0.1 | using_20data_20statements_20in_20libraries [2024/01/05 00:21] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| //by Richard Russell, March 2011//\\ \\ Because you cannot use **line numbers** or **labels** in libraries (or other [[http:// | //by Richard Russell, March 2011//\\ \\ Because you cannot use **line numbers** or **labels** in libraries (or other [[http:// | ||
| + | <code bb4w> | ||
| DEF PROCrestore | DEF PROCrestore | ||
| RESTORE +1 | RESTORE +1 | ||
| Line 7: | Line 8: | ||
| DATA Here, | DATA Here, | ||
| DATA Here, | DATA Here, | ||
| + | </ | ||
| Calling **PROCrestore** moves the data pointer so that the next items to be [[http:// | Calling **PROCrestore** moves the data pointer so that the next items to be [[http:// | ||
| + | <code bb4w> | ||
| PROCrestore | PROCrestore | ||
| READ A$,B$,C$,D$ | READ A$,B$,C$,D$ | ||
| + | </ | ||
| (this code could be in the main program or in a library).\\ \\ Note the use of **RESTORE +1** rather than **RESTORE +2**, as might superficially seem more correct. This ensures that the code will work correctly even if the library is crunched using the **concatenate lines** option (resulting in the **ENDPROC** being moved onto the same line as the **RESTORE**).\\ \\ If you find that disconcerting you could always move the **ENDPROC** until after the **DATA** statements: | (this code could be in the main program or in a library).\\ \\ Note the use of **RESTORE +1** rather than **RESTORE +2**, as might superficially seem more correct. This ensures that the code will work correctly even if the library is crunched using the **concatenate lines** option (resulting in the **ENDPROC** being moved onto the same line as the **RESTORE**).\\ \\ If you find that disconcerting you could always move the **ENDPROC** until after the **DATA** statements: | ||
| + | <code bb4w> | ||
| DEF PROCrestore | DEF PROCrestore | ||
| RESTORE +1 | RESTORE +1 | ||
| Line 16: | Line 21: | ||
| DATA Here, | DATA Here, | ||
| ENDPROC | ENDPROC | ||
| + | </ | ||
using_20data_20statements_20in_20libraries.1522502389.txt.gz · Last modified: 2024/01/05 00:16 (external edit)