DO11: Syntax of the new global variables

The syntax of the new global variables has beaten me. I tried a button with:


@set glob!:VarA=SomeFilename
FileType New .txt NewName {$VarA}


but it creates a new file called "New Text Document.txt" rather than "SomeFilename.txt". That is, the first line has been ignored. Replacing "glob!:" by "glob:" makes no difference. Obviously I'm misunderstanding something.

glob: forms part of the variable name, so you need to include it when using the variable:

@set glob!:VarA=SomeFilename FileType New .txt NewName {$glob:VarA}

Thanks very much, Jon. That was extremely quick! And with "!" it survives reboot, as promised.

Interestingly, whether a variable is prefixed "glob:" or "glob!:", it seems that it can subsequently be referred to as either "glob:..." or as "glob!:...".

Next question: Can you do arithmetic with DOpus variables, as you can in DOS? (I'm experimenting with replacing some of my environment variables with DOpus variables.) Specifically, I have set the variable "glob:ThisYear" to 2013 with the command


@Set glob:ThisYear={date|yyyy}


Can I set the variable "glob:LastYear" to 2012, either by subtracting 1 from 2013 or from 13, or by varying the command {date|yyyy} or the command {date|yy}?

For arithmetic you'd need to use scripting.

Thanks, Leo. Yet another spur to get disciplined and learn scripting.