This version is out of date, covering development from v9.5.0 to v9.7.3. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v9 Icon

Variables

Action code allow for the use of user-defined variable within action code. A primary use of these is to avoid the need for a lot of user attributes just to hold interim values during more complex actions or for re-use of a value within loops and the like.

Variables are declared in an action and cease to exist at the end of the action. To hold the value further, the existing value would need to be stored in an attribute.

Variables are created using the var() operator.

A declared variable can be passed into action code operators as arguments and as arguments to user-defined functions. In export template, a variable declared in an ^action()^ code block can be addressed anywhere in the rest of the template (following/below the point of declaration) and inserted into the exported code using ^value()^ just as if inserting an attribute value. Thus ^value(vSomeValue)^ inserts the value of variable 'vSomeValue' into the exported code stream (note: unlike an attribute there is no $-prefix used). Also see: