Evaluating Expressions at Runtime
Value Function
Behavior:
The expression is evaluated in the context of the current handler. It may include variables (such as total in the second example above), operators, function calls, and so forth. If the evaluationContext property is set to Global or Universal, variables are treated as global or universal rather than local. If an error occurs while obtaining the value of the expression, the result function returns an exception object describing the problem.
Syntax:
Syntax definitions for language elements follow these formatting guidelines:
- boldface: Indicates words and characters that must be typed exactly
- italic: Indicates expressions or other variable elements
- {} (curly braces): Indicate optional elements.
- [] (square brackets) separated by | (vertical pipes): Indicate alternative options where one or the other can be used, but not both.
Example syntax:
In this example, "open file" is required and must be typed exactly. "fileName" is a variable element; it is the path to and name of the file being opened. The following expression is optional and indicates why the file is being opened. If this expression is added, "for" is required and must be typed exactly. One of the following must be included, but only one, and they also must be typed exactly: "reading", "writing", "readwrite", "appending", or "updating".
Examples:
put the value of "51+93" into sum -- sets sum to 144
put value("total is greater than quarter" & bestQtrNum) into best
put value("(" & commaSeparatedText &")") into myList
put the value of file "storedProperties" into pList
Related:
- The Merge Function
- The Do Command