Contents / Reference section / BASIC keywords / Previous letter / Next letter / Index
To "remove" a program from the computer's memory. In fact the program is still there but the computer has been told to forget about it. If you want to, you can usually recover the old program by typing OLD. This only works if you have not entered any part of another program.
NEW is normally used as a command before typing in a new program - to ensure that the computer has forgotten all its previous instructions.
NEW does not clear any of the resident integer variables A% to Z% or @%.
A command which resets internal pointers to "delete" all program statements. The program may be recovered with OLD provided no new statements have been entered and no new variables have been created. Since it is a command it cannot form part of a multiple statements line.
This is used in conjunction with FOR to make the computer loop around a set of statements a number of times.
If the loop is opened with (for example)
FOR speed=10 TO 100
then the NEXT statement would normally be in the form
but the word "speed" is optional.
350 FOR X=0 TO 640 STEP 2
370 DRAW X,Y
A statement delimitting FOR...NEXT loops. The control variable (X in the last example) is optional.
If a variable is given after NEXT then the computer will "pop" other FOR...NEXT loops off the "stack" until it finds a matching variable. If none is found, an error will be reported.
FOR, TO, STEP
This is normally used with an IF...THEN statement to reverse the effect of some test. For example
680 IFNOT (A=6 AND B=5) THEN PRINT "WRONG"
If A=6 and B=5 then the computer will not print
NOT is a high priority unary operator equivalent to unary minus.
<testable condition>=NOT (<testable condition>)