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

Errors and warnings while writing a procedure

Introduction

Before you can run a test, any procedures that have been defined must be valid. If there are any errors in a procedure, then the test will not run (you'll be warned of this on the Tests page and given the opportunity to edit the procedures at this point).

If you want to run a test without a procedure - say you're in the middle of writing a procedure, and you know that it's not yet working properly - you can disable the procedure to prevent it being used.

The ANY-maze procedure editor allows you to run a check on a procedure at any time, to see if it is valid - just select the Check for errors button.

Procedures will still run if they contain any warnings; it is only errors that will stop a test from starting.

Checking for errors

You can check a procedure you're currently editing for errors using the Check for errors button. This will check through the procedure to see if it's able to run during a test.

Errors and warnings are shown in an information window at the bottom of the procedure editor. If there are no errors or warnings, then the window will remain closed and its title will be blue, showing that there are no problems:

  

  

Figure 1. Procedure information, if there are no errors or warnings.

If there are any errors or warnings, then the window will open, and its title will change colour to red (if there are any errors) or yellow (if there are only warnings). All errors and warnings will be listed within the window, and a small error or warning image will be shown in the left-hand margin of the procedure itself, at the position where the problem has occurred. These images will be light in colour, but clicking on one of the lines in the information window at the bottom will highlight that specific error or warning in the procedure, and darken the image to make it clear where in the procedure the problem is.

  

  

Figure 2. A procedure with errors. One of the errors has been selected in the information window, and is highlighted in the procedure.

The information window can be opened or closed using the little arrow at the right-hand side of its title.

More information

The most common errors when writing a procedure are those that result in a parameter to a statement being missing - for example, waiting for an event but forgetting to specify which event to wait for (like the first error in the example in figure 2, above). However ,there are a number of possible errors that may occur when writing a procedure, and they are listed below.

Errors and warnings

There are a number of errors and warnings that can be generated when you check the procedure for errors. If you need further information, click the link for the relevant line in the list of errors and warnings at the bottom of the procedure editor to go to an explanatory help topic.

The following errors and warnings may appear in this list:

Errors

 Error: Both sides of an 'AND' operator cannot contain events. 
 Error: Cannot use an event in an 'if' statement without first waiting for that event to occur. 
 Error: The left-hand side / right-hand side of the operator must be specified. 
 Error: Both sides of the operator cannot be 'time elapsed' events. 
 Error: The event must have a parameter specified. 
 Error: The function must have both parameters specified. 
 Error: The function must have at least two parameters specified. 
 Error: Statement does not have a parameter specified. 
 Error: The expression must have a parameter specified. 
 Error: The action/event must be specified. 
 Error: The zone used for a variable is not valid. 
 Error: Labels must be unique. 
 Error: The variable passed to the 'Set variable as a test result' action must be a single value variable, set up to be a result for tests. 
 Error: The field is the wrong type. 
 Error: Cannot use a 'Wait' statement before the test has started. 
 Error: Cannot wait for the 'Test is waiting to start' event after the test has started. 
 Error: Cannot use a variable that relies on tracking information before the test starts. 
 Error: The procedure tries to set the location of a movable zone after the test has started. 
 Error: The procedure tries to prevent/allow test start after the test has started. 
 Error: To set the position of a movable zone from a procedure, you must set up the zone's location for this stage to 'The location will be set by a procedure'. 
 Error: Cannot end the test before it has started. 
 Error: Cannot end the test after it has already finished. 
 Error: Cannot schedule another test for this animal before the test starts. 
 Error: Cannot use treatments within this procedure: the protocol has been set up not to use treatments. 
 Error: Cannot call a sub-procedure recursively.  

Warnings

 Warning: This procedure has no executable statements. 
 Warning: This procedure has a loop, but no 'Wait until' statement. 
 Warning: The Repeat/If statement does not have a clause specified. 
 Warning: The procedure uses the 'Test is running' or 'Test is paused' variable before the start of the test. 
 Warning: The variable passed to the 'Randomise array' function is not an array variable. 
 Warning: The 'Randomise array' function failed. 
 Warning: The variable passed to the 'Sort array' function is not an array variable. 
 Warning: The variable passed to the 'Initialise array' function must be an array variable. 
 Warning: The variable passed to the 'Copy array' function must be an array variable. 
 Warning: This event will never occur. 
 Warning: This variable is not in use for the current protocol settings. 
 Error: Both sides of the operator are constant expressions.  

See also:

 Errors and warnings while running a procedure 

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T0499