ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Testing > Procedures > Sharing and re-using procedures

Sharing and re-using procedures

Introduction

Procedures can be reused in different experiments, or even shared between labs. This is done by exporting a procedure from one experiment, and then importing the procedure into a different experiment.

Obviously, there are some potential problems with this - if you're trying to share a procedure between two open-field experiments, for example, you might run into difficulties if one experiment has called a zone the 'centre' zone, and the other has called it the 'middle' zone.

This topic describes how to import and export procedures, and gives some advice on how to deal with potential problems that might arise.

Exporting a procedure

Exporting a procedure involves saving it to an XML file on your computer. Each individual statement in the procedure is saved with its own XML 'tag'.

Any references to items in the protocol (e.g. zones, points, sequences etc.) are made by name. So in the case of the water-maze example that is shipped with the ANY-maze software, the resulting XML will look a bit like this (some of the XML has been removed for clarity):

  

 

   

     

       

          ZONEENTRY

         

            Island

         

       

     

   

   

     

       

          STOPTEST

         

            Found platform

         

       

     

   

 

Importing a procedure

Importing a procedure involves taking an existing XML or text file and loading it into the procedure editor. The file must contain a specific format that the procedure editor can understand.

Providing the file contains a valid format, a brand new procedure will be created and the file will be loaded into it.

What happens if there are problems?

There are a number of possible problems that can occur when trying to import a procedure from an XML file. If the XML itself is invalid (i.e. it doesn't describe a procedure, or has become corrupted in some way), then you'll be warned with a message and nothing will be imported.

Even if the XML itself is valid, there are still some potential issues. For example, in the XML file above there's a zone called 'Island' (it's been highlighted) - so ANY-maze will attempt to find a zone with that name and link the procedure up to it. However, if the protocol you're importing the procedure into has used the name 'Platform', ANY-maze won't be able to determine which zone to use.

If this happens, you'll be prompted to choose the equivalent items  - see Making sure the protocol items in a procedure match your protocol).

Importing procedures with variables

If a procedure contains user-defined variables, then new variables with those names will be created for the newly-imported procedure.

If a procedure is loaded that uses a shared variable (i.e. one that is shared between all procedures), and a shared variable already exists with the same name, then the new procedure will simply use the existing variable.

However, if a procedure contains a variable that is not shared, but has the same name as an existing shared variable, then the name of the imported variable will be adjusted to be unique (e.g. a variable called 'Count' might be renamed to 'Count (2)'). This is because variable names need to be unique within any given procedure.

See also:

 User-defined variables 
 Making sure the protocol items in a procedure match your protocol 

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T0472