detokeniser
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| detokeniser [2018/03/31 13:19] – external edit 127.0.0.1 | detokeniser [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| =====Detokeniser===== | =====Detokeniser===== | ||
| - | //by Jon Ripley, January 2008, May 2011//\\ \\ | + | //by Jon Ripley, January 2008, May 2011// |
| + | |||
| + | The // | ||
| + | |||
| + | <code bb4w> | ||
| DEF FNdetokenise(S$) | DEF FNdetokenise(S$) | ||
| IF S$ = "" | IF S$ = "" | ||
| Line 52: | Line 56: | ||
| NEXT i% | NEXT i% | ||
| =O$ | =O$ | ||
| - | \\ | + | </ |
| ==== Using FNdetokenise to list the error line ==== | ==== Using FNdetokenise to list the error line ==== | ||
| - | \\ // | + | |
| + | // | ||
| + | |||
| ==== Using FNdetokeniser to write a Quine ==== | ==== Using FNdetokeniser to write a Quine ==== | ||
| - | \\ | + | |
| + | Using // | ||
| + | |||
| + | <code bb4w> | ||
| P% = PAGE | P% = PAGE | ||
| WHILE (!P% AND & | WHILE (!P% AND & | ||
| Line 67: | Line 77: | ||
| ENDWHILE | ENDWHILE | ||
| END | END | ||
| - | In the author' | + | </ |
| + | In the author' | ||
| ==== Using the built-in detokeniser ==== | ==== Using the built-in detokeniser ==== | ||
| - | \\ | + | |
| + | The //BBC BASIC for Windows// and //BBC BASIC for SDL 2.0// interpreters have a built-in detokeniser accessed using the ***LIST** command that detokenises a specified file and outputs the listing on the current output device. Whilst it is possible to write a simpler looking detokeniser utilising ***LIST** the resulting routine is significantly slower due to the number of file operations required. | ||
| + | |||
| + | <code bb4w> | ||
| DEF FNdetokenise(S$) | DEF FNdetokenise(S$) | ||
| IF S$="" | IF S$="" | ||
| Line 96: | Line 111: | ||
| SYS " | SYS " | ||
| =S$ | =S$ | ||
| - | \\ \\ **Do not use** this version in production code. | + | </ |
| + | |||
| + | **Do not use** this version in production code. | ||
detokeniser.1522502355.txt.gz · Last modified: 2024/01/05 00:18 (external edit)