Contents / Reference section / BASIC keywords / Previous letter / Next letter / Index


N

NEW

Purpose

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 @%.

Example

NEW

Description

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.

Syntax

NEW

Associated keywords

OLD

NEXT

Purpose

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

NEXT speed

but the word "speed" is optional.

Example

340 length=100

350 FOR X=0 TO 640 STEP 2

360 Y=2*length+250

370 DRAW X,Y

380 NEXT

Description

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.

Syntax

NEXT [<num-var>]

Associated keywords

FOR, TO, STEP

NOT

Purpose

This is normally used with an IF...THEN statement to reverse the effect of some test. For example

Examples

680 IFNOT (A=6 AND B=5) THEN PRINT "WRONG"

If A=6 and B=5 then the computer will not print

WRONG.

Description

NOT is a high priority unary operator equivalent to unary minus.

Syntax

<num-var>=NOT<numeric>

or

<testable condition>=NOT (<testable condition>)

Exit: BBC Microcomputer User Guide; Kasoft Typesetting; Archer


The BBC Microcomputer User Guide was written by John Coll and edited by David Allen for the British Broadcasting Corporation.

Optical character recognition and original formatting effort by Mark Usher.

HTML version maintained by: Kade "Archer" Hansson; e-mail: archer@dialix.com.au

Last updated: Monday 12th February 2001