Using the "!" in the predefined variable "ShortDate" - Forum

Forum Navigation
You need to log in to create posts and topics.

Using the "!" in the predefined variable "ShortDate"

When obtaining the short date from the system - short date format here in the USA is: "MM/DD/YY" for example, I use something like:

setvar "[!DateAdded]" "![DateShort]"

Notice that the "!" is outside of the opening and closing "[" & "]" on the predefined variable "[DateShort]"

When you subsequently use the "[DateAdded]" variable, for a label or text field, you must use this form:

[!DateAdded] - Note how the "!" is now inside the "[" & "]"

I played around with this for some time and the only way I could get a system date was to place the "!" outside the parenthesis of the predefined variable. Short date has literal characters, "/" which are also mathematical operators, thus you must use "!" to prevent a math operation occurring.

Anyone else notice having to use the "!" outside of the ShortDate predefined variable?

Chris

Fort Worth, TX

Normally, if value contains a valid mathematical formula, VisualNEO for Windows will compute the formula and store the results in the variable. If for some reason, you want the variable to contain the actual formula instead of formula's computed result, insert anexclamation point “!” at the beginning of value. For example, the following statement:

SetVar "[Test]" "1+1"

will set the variable [Test] to "2". This is because VisualNEO for Windows knows that "1+1" is a mathematical equation and adds the two numbers together. By adding an exclamationpoint you can instruct VisualNEO for Windows to ignore the formula. For example:

SetVar "[Text]" "!1+1"

will set the variable [Test] to "1+1". (Note: The exclamation point is removed by VisualNEO for Windows.) You can use this technique in any VisualNEO for Windows Action where numeric parameters are allowed.

Source: VisualNEO Variables

Open chat
1
Do you need more info?
Hi, do you have any doubt?