This version is out of date, covering development as far as v4.2.5. It is maintained here only for inbound reference links from elsewhere. Jump to the current version of aTbRef. |
A Tinderbox Reference File : Actions & Rules : eval() operator |
eval() operator |
From v4.2.0, eval() takes a single string as an argument and evaluates it. Thus
if(MyBool){AttribX="$Name(parent)"}else{AttribX="$Name(grandparent)"};AttribY=eval($AttribX)
will set AttribY to the name of the current name's note or it's grandparent depending on the value of attribute MyBool by evaluating attribute AttribX.
The eval() operator also allows access to 2 properties - current TBX document's filename (sans extension) and app version) - that aren't available via action syntax:
eval(^docTitle^)
- gives a value of "aTbRef" (note no '.tbx' extension)
eval(^version^)
- gives "4.2.5" (note - you might want to prefix the return string with 'v' or 'v.' thus: "v.4.2.5")
Up: Actions & Rules | |
Previous: exportedString() operator | Next: idEncode() operator |
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]