Authors
Publication
Pub Details
Date
Pages
BASIC Terms
Sometimes a programming problem can be easily solved by using certain tricks. Here are a few tips and techniques to help you possibly the next time you get stuck. I hope you will find them useful.
The Save Problem
To replace the message “Start tape then press Enter” you just need to POKE 26689,38. Try:
10 PRINT #0; "All right, I'm ready."'"Start your tape"'"AFTER that press ENTER"
20 POKE 26689,38:SAVE "demo"
For those with a Spectrum ROM, POKE 23736,181 starts SAVEing immediatly, without waiting for a key press.
The Scroll Problem
This little machine code routine scrolls a certain number of lines during a certain time. These codes can be put anywhere in memory.
10 CLEAR 49999
20 FOR I=50000 TO 50020
30 READ A: POKE I,A
40 NEXT I
50 DATA 205,220,27,205,96,38,237,67,250,91,197,253,
70,192,205,59,9,193,16,246,201
Use this routine with INPUT USR add,x,y where add=start address and x= 1st line to be scrolled, y=how many times. With the routine at 50000, try:
10 CLS
20 PRINT "....Don't move................"
30 INPUT AT 0,0;"Write something:";LINE a$
40 INPUT USR 50000,22,1
50 PRINT AT 21,0;a$
60 GO TO 30
The Load Problem
Large programs are generally recorded in several parts on cassette. After the loader program, a screen presentation is loaded and the main program is now ready to be loaded. But it’s not very esthetic when the program name overprints the screen presentation.
To avoid this situation, we can add to the loader program POKE 23570,16 and in the main program, we must restore by using POKE 23570,6. PRINT and LIST will be corrupted otherwise.
The INKEY$ Problem
Suppose we have: 50 IF INKEY$="Y" THEN GO TO 100. If the keyboard is in lowercase mode, the computer will see “y” instead of “Y” and pass on to the next line. Again POKE will rescue us:
POKE 23658,8 for UPPERCASE mode
POKE 23658,0 for LOWERCASE mode
POKE 23617,2 for GRAPHIC mode
POKE 23617,1 for EXTENDED mode