Macro generation

In application mode the Unravel Options dialog allows a choice between unconditional loading of the default macro set via the program using option "Use default macros" and loading it from an external file with the "Read macro files from user's computer" option selected. If the former option is adopted, the default macro set is generated and loaded each time the program automatically performs the Load macros function or the user manually requests the loading when in Menu mode. If the latter option is in use, the program will look for a macro command (definition) file as soon as the cube size has been set and no change will be made to the stored macro file if it exists. The macro command sequences and associated help text for cubes are stored in files with default name urvcmdnny.txt where "nn" represents the cube size (in range 02 to MaxCubeSize) and "y" is either blank or "m" or "s" dependent on marking status.

When macros are loaded, only the macro command sequences are used, whereas both the command sequences and the help text are used when macro help is displayed. If the required urvcmdnny.txt file is found, when an attempt is made to load macros or show macro help, that file will be read. If the file is not found, the user is given the opportunity of using the default macro file that is generated, stored on disk or other storage medium, and re-loaded when the Load Macros command is executed.

The same macros as those for cubes with unmarked centres are used for those with marked centres but some extra macros and instructions are added. To distinguish from the unmarked centres files different filenames are required (urvcmdnn.txt, urvcmdnnm.txt and urvcmdnns.txt are used).

If users wish to generate their own macro files, they can either edit the default files, which can be generated by the program, or create their own files from scratch (but users must use the same filenames as those used for the default macros). In either case, certain rules need to be observed. To see the rules for defining macro command sequences, refer to Macro definition. Two special types of help text need to be identified in the macro command (definition) files.

1. Topic Identifier

The program will sub-divide the macro help text according toTopics. A Topic is identified in the urvcmdnn.txt, urvcmdnnm.txt and urvcmdnns.txt text files by placing the sequence \*\ at the beginning of the line containing the heading. The following provides an example of the use of \*\.

\*\  First Layer Corner Location Macros

Locate first layer at the bottom and shift from top left to bottom left. Use A if front face is same as the bottom, C if side face is the same as the bottom and E if the upper side is the same as the bottom.

* A = FU-F
* C = -L-UL
* E = -LULUUC

2. Delimiting Constant Pitch Text

Apart from the macro command sequences (that are always displayed using constant pitch text), it is desirable that some help text sequences receive the same treatment. Use the start delimiter //* and end delimiter /*/, as illustrated below, in such instances.

//*
   Row 1:  xx   xx   xx   xx
   Row 2:  xx  <22> <23>  xx
      xx = don't care
/*/

In applet program mode the same file structure applies but file recording is required only if users develop their own macro set.