NULL Statement

The NULL statement results in no action. It is meant as a filler for clauses that require a statement, regardless of whether or not action is necessary.

Format

NULL

Description

The NULL statement has been devised for situations in which a statement is required but no operation is to be performed. It is seldom necessary, but often used for program readability and consistency.

Example

This example demonstrates how the NULL statement can be used within an IF construct.

IF ZIP MATCHES "5N" THEN

   NULL

END ELSE

   .

   .

   .

END

In the preceding example the NULL statement is used as a placeholder. The THEN clause requires at least one statement, so the NULL statement is used to allow the program to compile.

Note that in mvBASIC this construction is not required; the THEN clause is not mandatory in an IF statement, as long as an ELSE clause exists. However, if the THEN clause is omitted, the statement would make sense to the compiler but it might not to the reader. The NULL statement is used to make clear to the reader that if the match returns a value of true, no action is taken.

See Also

Statement and Function Reference