ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Testing > Procedures > Writing a procedure using the procedure editor > Errors and warnings while writing a procedure > Warning: The Repeat/If statement does not have a clause specified

Warning: The Repeat/If statement does not have a clause specified

Description

Within a procedure, Repeat statements and If statements are 'containers' for other statements; that is, they have groups of statements called 'clauses' that run when certain conditions are true. A Repeat statement has a clause that runs while (or until) the statement's condition is true; this clause is the group of statements contained within the statement. An If statement has a clause for each condition that it evaluates; it must have at least one condition, and therefore at least one clause.

If a Repeat statement or an If statement do not contain any statements as a clause, then this warning will be generated in the list of errors and warnings at the bottom of the procedure editor when the procedure is checked for errors.

Note that if this warning is ignored, the procedure will still run, but the statement will not do anything if the condition is true. This will be ignored for If statements, as it's possible to write a valid procedure with an empty clause for an If statement, but for Repeat statements, another warning will be generated when the procedure encounters this statement while running.

Example

The following procedure doesn't have any statements contained within the Repeat statement, so will generate this error.

  

  

Figure 1. The repeat statement in this procedure doesn't have a clause.

If you receive this warning for a Repeat statement, you should ensure that the statement has a clause. For an If statement, you should review the procedure to see if it's really what you intend. If it is, then simply inserting a Note statement as the clause, with some explanatory text like 'Do nothing', will prevent this warning from being displayed.

See also:

 Errors and warnings while writing a procedure 
 Errors and warnings while running a procedure 
 The Repeat statement 
 The If statement 
 The Note statement  

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T0529