|
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
IntroductionThe 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. ExampleThe 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.
More informationLabels 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:
© Copyright 2003-2026 Stoelting Co. All rights reserved ANY-maze help topic T0484 |