|GSAK (Geocaching Swiss Army Knife)|
Eval(sData) : String
Use this function to evaluate and convert the value of any special tag(s) to a string variable, when variable substitution is off. The function returns the converted special tag(s), but you can also include string literals. For example if the current waypoint has the code of "GCABCD" and smart name of "BigRed", then:
Using eval() with variable substition turned off, will also ensure you don't get a syntax error if the data contains " (double quotes). For example, if the cache name was - My "little cache"
Then the following code would cause a syntax error in the macro because of the extra double quotes when the special tag is resolved:
To make sure you don't get a syntax error when using special tags this way you would need to use the following code:
Of course the following code would give you the same result:
However, there are times when you need to expand special tags in this way (when using a form input for example)
Note: This function supersedes the GetSpecial command and is much quicker.
Alpha List Category List
Copyright 2004-2014 CWE Computer Services |