Expressions

You can use expressions to specify Integer values in the Resource Editor, the Style Editor, and the Integer Editor. Expression grammar in Builder Xcessory is as follows:

<expression> := <integer value> | <constant name>
| <expression> + <expression>
| <expression> - <expression>
| <expression> * <expression>
| <expression> / <expression>
| (<expression>)
| - <expression>

Expressions are evaluated from left to right. Standard order of precedence is enforced for binary operator expressions. The following conditions apply to expressions:

Expression conditions

· When an expression is entered in a resource or Style Editor text field, the expression is evaluated, and the result is assigned to the widget resource. The label to the right of the text field in the resource list is changed to Expr.

· To use an expression in the Integer Editor, select the Expr toggle. The string entered in the extended editor will be evaluated to a numeric value and that value assigned where appropriate.

· The calculated value will be re-evaluated for expressions that use constants if any of the constant values change. Any references throughout the interface will use the new value.

· If a widget or style resource value depends on an expression which includes a constant that is Cut from the Constant Manager, then the widget's resource will change from Expr to Code and its value will be set to the previously evaluated integer value.

 

Documentation: