eval() operator

Tinderbox Icon

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 

[Last updated: 3 Dec 2008]

Google search aTbRef for:  

Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]

Creative Commons License

Made with Tinderbox