Overview
You can use the expression evaluator as a testing ,as well as learning tool when using complex expressions in Cold Fusion 2.0. You can use the evaluator to compose complex expressions and test their evaluation. The evaluator also enables you to open, save and mail expression statements tested in the evaluator.
Using the Evaluator
Use the evaluator form to enter expressions you would like to evaluate. The evaluator processes the expressions you enter line-by-line providing you with the possibility to evaluate multiple expressions. In addition you can assign the results of your expressions to variables which can then be used in subsequent expressions. Here is an example. Click the EVALUATE button to test the expressions. When done, click the BACK button to get back to HELP.
You have noticed the ways the evaluator outputs the results of the expressions entered. It lists the expression along with its line number followed by the output of the appropriate result.
Assignment of expressions to variables can be very powerful as you can simulate variable manipulations as they are occurring in your Cold Fusion applications. However, you need to remember to use the VariableName=Expression syntax as you CANNOT use CFML tags within the evaluator. The following example demonstrates the use of the evaluator to test the behavior of some of the date functions:
Using Comments
You must have already noticed that comments can be used in between the expression statements providing you with a way of documenting your testing. Simple use // to delineate each line of comments.
Resolving Errors
The evaluator is a simple application written in Cold Fusion. When encountering an invalid expression the evaluator throws a regular Cold Fusion error message pointing at the line of code inside the evaluator which attempted to evaluate your expression. Ignore the evaluator code printed at the top of the error message. Scroll down to the bottom of the error message where is usually displayed the expression which causes the error.
Opening, Saving and Mailing Expressions
For your convenience the evaluator enables you to open simple text files into the expression window, as well as, to save expressions into text files. Use this functionality if you prefer to keep a reference of the expressions tested with the evaluator. You can also e-mail your expressions directly from the evaluator for added convenience. This may be a useful feature when forwarding expression samples to your colleagues or forwarding problems to Allaire Technical Services .
REMEMBER - No use of CFML tags is allowed inside the evaluator.