The Regnus Scripting Tutorial
Part 7: Naming Numerics
Of course, in large scripts, it can quickly get confusing if you're using lots of slot numbers and need to remember which is used for what!
However, there is a way to get around this, which is to name your slots something descriptive so that you can remember quickly what they're being used for.
Now, usually, if you were to pass a non-numeric character to a slot expression, it would resolve the contents of slot 0, since non-numerics are always assumed to have a value of zero. So, for instance, the following script would work fine:
GROUP Example
ENTRY <Storage Example>If we store the text "#>(NonNumeric):(Hello!);" like this, it will be stored in slot 0. It can then be retrieved the same way: "##[NonNumeric];"
However, there is a way to associate non-numeric expressions with specific numbers, so that these expressions will return those numbers instead when used in expressions which are read as numerics, for instance in slot expressions...
This is achieved using a new qualifier: "REFER". It is used as follows:
REFER 10:SlotName
GROUP Example
ENTRY <Storage Example>If we store the text "#>(SlotName):(Hello!);" like this, it will be stored in the slot we defined. It can then be retrieved by number: "##[10];"
As you can see, in a "REFER" qualifier, you define first a number, and then a name for that number, separated by a colon (":") character. The "REFER" qualifier can be placed anywhere in the script, and does not necessarily have to come earlier in the script than a reference using it.
The "REFER" qualifier is not limited to slot numbers, remember; there are also other reference types which require numeric values, and this method will work just as well for those!
Note: there is no reason at all that you can't give several names to the same slot number, should you wish!