NULL Statement
Specifies no operation.
Syntax
NULL
Comment
A NULL statement can be used anywhere in a program where a DataBasic statement is required.
Examples
10 NULL
Results in no operation; however, because it has a statement label, it can be used as an entry point for a GOTO or GOSUB statement. A REM statement would work just as well in this case. The following examples demonstrate more practical uses of the NULL statement.
IF A=0 THEN NULL ELSE PRINT "A NONZERO" GOSUB 45 STOP END
Executes the statements in the ELSE clause if the value of A is nonzero. If A=0, no action is taken and control passes to the statement following END.
READ A FROM "ABC" ELSE NULL
Reads file item ABC and assigns it to variable A. If ABC does not exist, no action is taken.
IF X1 MATCHES "9N" THEN NULL ELSE GOTO 100
Branches to statement 100 if the current value of X1 does not contain 9 numeric characters. If it does, then no action is taken and control passes to the next sequential statement.