ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Testing > Procedures > Elements of a procedure > Statements available to procedures > The Label statement

The Label statement

Introduction

The Label statement is usually used in conjunction with a Go to statement, to perform simple loops in a procedure. It can also be used without a Go to statement, to simply show the start of a new section of a procedure.

Within the procedure, the statements after a label are indented to show that it is the start of a new section of the procedure.

Example

The following example shows a Label statement used in conjunction with a Go to statement, to perform a simple loop which executes continually throughout the test.

  

  

Figure 1. A procedure showing the use of the Label statement along with a Go to statement, to perform a simple loop.

This same logic could also have been implemented using a Repeat statement.

More information

Labels within a procedure must have unique names, to ensure that a Go to statement can differentiate between them. If you try and define a procedure with multiple labels with the same name, an error will be generated when you check the procedure for errors or exit the procedure editor.

A Label statement can be inside a container If statement or Repeat statement, so that a Go to statement can jump into the container and execute from there. However, this will result in quite complex logic within the procedure, so I don't recommend that you do this!

See also:

 Statements available to procedures 
 The Go to statement   
 The Wait until statement   
 The Action statement 
 The Repeat statement   
 The If statement     
 The Set value statement    
 The Run sub-procedure statement  
 The Note statement   
 Other statements 

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T0484