Navigation: Language Reference > 10 - Expressions > Runtime Expression Evaluation >====== BINDEXPRESSION(declare runtime expression) ====== | |
BINDEXPRESSION( | name,expression | )
BINDEXPRESSION | Identifies variables allowed to be used in dynamic expressions. |
name | A string constant containing the identifier used in the dynamic expression. |
expression | A mathematical formula containing any valid combination of variables, functions, operators, and constants. |
The BINDEXPRESSION statement declares the logical name used to identify an expression used in runtime expression strings.
The EVALUATE statement must parse an expression every time it is called. If some expression is evaluated frequently, this can be time consuming.
BINDEXPRESSION parses the expression only once and is saved in a pre-compiled form under the given name. Later, this expression can be used in EVALUATE as a stand alone, or as a part of another expression in EVALUATE, or in another BINDEXPRESSION.
Example:
BIND('Var', Var)
BINDEXPRESSION('Power2', 'Var * Var')
…
Var = 10
P2 = EVALUATE ('Power2')
…
BINDEXPRESSION ('Circle', '3.14159 * Power2')
BINDEXPRESSION('color:red',color:red)
MESSAGE('color:red = ' & color:red & '|Eval(color:red)=' &|
EVALUATE('color:red') ) !Shows same number twice
BINDEXPRESSION('Match:Soundex',Match:Soundex)
FILTER('MATCH(Cus:Name,NameWanted,Match:Soundex)')
See Also: