qp.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Empty Statement
  Simple Statement Contents Index                           Back
 
  Description
 
    An empty statement exists whenever the Pascal syntax indicates
    that a statement could exist but doesn't. Given this condition,
    the compiler inserts an empty statement into the program. The
    empty statement is a null action. Some empty statements are
    harmless, but others are fatal. The following example illustrates
    a harmless empty statement:
 
       BEGIN
       <statement>;
       <statement>;
       END
 
    Because semicolons separate statements, the compiler inserts an
    empty statement to follow the second semicolon. In this case, the
    empty statement is harmless. It even prevents a common programming
    error if another statement is added to the end of the block.
 
    The following example illustrates a subtle bug introduced by an
    empty statement:
 
       IF input_incorrect THEN;
           get_input;
 
    The intent of get_input is obvious to a programmer; however, the
    compiler understands the semicolon after THEN to indicate an empty
    statement. To QuickPascal, this example means: if input_incorrect,
    then do nothing; now get_input.