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 : Export Codes : Export Codes - Full Listing : ^value( expression ) |
^value( expression ) |
^value(expression)^
This code is new to v4.0.0. The argument to ^value^ is an expression — a value that could be assigned to an attribute. ^value^ evaluates the expression and exports the result, as a string. This allows manipulations for export use without needing to, for instance, hold the value in a user attribute first.
^value^ is in effect a version of ^get^/^getFor^ but which allows the called attribute's value to be manipulated. For example:
^value($Width)^
exports the width of the current note, and is equivalent to
^get(Width)^
So you may use the two forms interchangeably even where no manipulation of the target attribute is required.
More examples:
^value(sqrt($Width))^
^value("Name: "+$Name)^
^value($Name+":"+$Name(parent))^
See also ^action (action )^.
You don't need to use ^value^ explicitly internally for actions and rules as the expanded v4.0.0 syntax already covers this.
Up: Calculation | |
Previous: ^sum( group , attribute[, precision] )^ |
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]