Bob’s Notebook: Larken Extended BASIC example

See all articles from Sinc-Link v8 n1
Author(s): Bob Mitchell
Publication: Sinc-Link
Pub Details: Sinc-Link v8 n1 (Volume 8, Issue 1)
Date: January/February 1990
Pages: 17

No heavy stuff this time. For a change of pace, here is a listing for an experiment with colour using both the ordinary BASIC provided by the TS2068 ROM and then the Larken Extended BASIC provided in the Larken ROM. Enter the listing and try it!

  1 REM playing with colour
5 REM by Bob Mitchell
10 CLS : FOR i=32 TO 255: PRINT CHR$ i;: NEXT i
15 PRINT #0;AT 0,0;"Ordinary BASIC...": PAUSE 120
20 INPUT "paper 0-7 ";p
30 INPUT "ink 0-7 ";i
35 BORDER p
40 POKE 23693,p*8+i
100 OVER 1: PRINT AT 0,0;: FOR i=0 TO 21: PRINT ,,: NEXT i
110 OVER 0
120 INPUT "1=again 0=cont. ";as
130 IF as THEN GO TO 15
140 PRINT #0;AT 0,0;"Press a key": PAUSE 0
200 PRINT #0;AT 0,0;"Larken Extended BASIC...": PAUSE 120
210 INPUT "paper 0-7 ";p
220 INPUT "ink 0-7 ";i
230 BORDER p: RANDOMIZE USR 100: PAPER p: RANDOMIZE USR 100: INK i
240 INPUT "1=again 0=stop ";as
250 IF as THEN GO TO 200
260 STOP
300 RANDOMIZE USR 100: SAVE "colour.B1" LINE 1

Some notes on the above:

1. Line 10 puts the character set on the screen as an example to work with.

2. Line 15 advises that Ordinary Basic will be used.

3. Lines 20 to 35 set up the colours; I have made the Border equal the PAPER colour which is a good idea when saving any screen$.

4. Line 40 does a formula POKE to sysvars address 23693 which holds the permanent colours set up by BASIC statements.

5. Line 100 prints blank lines with the new colours from line 0 to line 21. Note the PRINT ,, trick that saves putting in a line of spaces. The OVER 1 does this without affecting what is on the screen. The Line 110 cancels the OVER command.

6. Line 120 offers a choice of repeating this part or continuing on with the next part.

7. Line 130 uses IF as which means IF as=a positive number. If not then action goes to line 140.

8. Line 200 starts the second part and advises that the Larken Extended BASIC method will be used.

9. Lines 210 to 220 set up the colours.

10. Line 230 uses the Larken commands to change the colours without affecting what is on the screen; this is instantaneous as compared to the ordinary BASIC version.

11. Finally, there is a choice of repeating this section again.

Bob Mitchell Willowdale Ontario.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.