require
Both tasks listed above can be carried out using
if but sometimes they can become very complicated and repetitive. Therefore, Quantum has an additional testing statement,
require, specifically designed to increase the efficiency of this checking process. For more information on the
if statement, see
Statements of condition: if.
The require statement is used in three different ways:
▪Column validation. Tests columns against a given set of characteristics and deals with records not meeting the requirements according to a specified action code.
▪Testing the validity of a logical expression. Tests a logical expression and, if it is true, continues with the next statement. If the expression is false, the record is dealt with according to the given action code.
▪Testing the equivalence of logical expressions. Compares the logical value of a group of logical expressions. If all are true or all are false, the run continues with the next statement, but if the expressions yield a mixture of values the specified error action is carried out.
The actions which are carried out when the stated conditions are violated are determined by an error action code defined either in the
require statement itself or in a global statement placed at the start of the edit. For information about the error action code, see
action code.
The require statement has three forms, depending upon the function it performs, and these are described in the subsequent sections. Each one must start with the word require which can be abbreviated to r.
See also