Just a quick note regarding a difference between isValid and
<cfparam, to hopefully help others down the line...
(pay attention to line 5 - it is the difference between the
two)
Example #1:
<cfset foo.test = "" />
<cfset bar = queryNew("test") />
<cfset queryAddRow(bar, 1) />
<cfset querySetCell(bar, "test", "bla") />
<cfset foo.test = bar['test'] />
<cfoutput>#isValid("string",
foo.test)#</cfoutput>
<cfparam name="foo.test" type="string" />
In example #1, the isValid("string", ...) function does not
throw an error, but the <cfparam type="string"... does.
Example #2:
<cfset foo.test = "" />
<cfset bar = queryNew("test") />
<cfset queryAddRow(bar, 1) />
<cfset querySetCell(bar, "test", "bla") />
<cfset foo.test = bar['test'][1] />
<cfoutput>#isValid("string",
foo.test)#</cfoutput>
<cfparam name="foo.test" type="string" />
In example #2, no error is thrown.
As I mentioned, the difference is...
Line #5 in 1st example: <cfset foo.test = bar['test']
/>
Line #5 in 2nd example: <cfset foo.test = bar['test'][1]
/>
If you do not specify the query row number, when accessing a
query variable using array notation, isValid() may not throw an
error, however <cfparam> might throw an error.
Just an interesting observation.
-Aaron Neff