I try to avoid using the
Evaluate() whenever possible, it takes longer than other methods.
The FORM scope is actually a structure. The followinf variable can be writen 1 of 2 ways:
#FORM.myvar#
#FORM["myvar"]#
or, if you are passing a variable it can be:
<cfset string = "myvar">
#FORM[string]#
or
<cfset string = "var">
#FORM["my" & string]#
#FORM["my#string#"]#
So instead of writing it:
#form.#variable##
You would write it one of these ways, the last is perfered:
#form[#variable#]#
#form["#variable#"]#
#form[variable]#
Keep in mind, however, when a checkbox is passed to the next page, if it is not checked the the variable doesn't exists. So be sure to add:
<cfparam name="form.#variable#" default="No">
Functions to avoid
You should avoid the functions listed below. They tend to be slow, hard to read, or produce unexpected results. Use their alternatives instead (or simply rewrite your code to avoid using the function).
Avoid... Use this instead...
evaluate() Rewrite your code to avoid using this function.
iif() <cfif ...>
structFind() struct.key
incrementValue(x) x = x + 1 -
tleish