NUMBERS ARE NUMEROUS – THEY TAKE UP TOO MUCH MEMORY !!
Did you know that a number takes up more memory than a letter? We won’t dicuss how and why here – check your manual for that – just know that a number takes more memory than a letter. In every program certain numbers continually reappear – for example: “1” in commands like LET X = X + 1, etc. Perhaps certain addresses do reoccur in your program. To save space create a letter variable for your number – i.e. LET I = 1. Then your command becomes LET X = X + I thus saving four bytes of memory every time you use the expression! (I’ve heard this before – but thanks to Mr. Penny for reminding me)
SAVE SPACE IN TEXT – USE KEYWORDS !!
You can use each keyword in any text in a PRINT statement. The keyword is only one byte so you can save much space this way. For example – 10 PRINT ” INPUT the number THEN GOTO the NEXT QUESTION” Each of the capital words could be entered as a keyword. One problem – how do you get a “K” keyword when you have a “L” cursor? First, using SHIFT press “3” – this will get you “THEN” and a “K” cursor. Then enter your “K” keyword and use the “5” cursor and DELETE “THEN” !! In the example you save 13 bytes – enough for another two lines!
IN POKEing – USE THE CHARACTER NOT DECIMAL (from Geo. Penny)
Extensive poling of numbers can quickly use up memory. Mr. Penny shortened the process somewhat – compare the following: 10 POKE 16389,221 to 10 POKE a, CODE “<>”
See manual appendix for decimal amd character codes.
USE GOSUBS ON REPETIVE ROUTINES
If any sequence of commands appears twice in a program it normally should be a subroutine. That is you use GOSUB and RETURN, see the manual – TIMEX chapter 9. This will also help you organize your programming. And did you know that subroutines written at the start of a program will help it run faster – it looks funny but it is supposed to be true!
ELIMINATE UNNECESSARY STATEMENTS WITH CONDENSATION
Compare these two structures – they do mean the same thing – HONEST!
10 IF A = 100 THEN GOTO 100
20 IF A = 200 THEN GOTO 200 OR 10 GOTO 100 (AND A=100)+
30 IF A = 300 THEN GOTO 300 200 ( AND A = 200) + 300 40 IF A = 400 THEN GOTO 400 (AND A =300) + 400 (AND A= 400)
CAN THIS BE DONE IN ONE SHORT COMMAND? IT SURE CAN ! HOW ?