isDefined("variableName") and Len(variableName) are used in
different contexts. All form values are defined except checkboxes
without any data.
It would be apt to do short-cut evaluation like
<cfif isdefined("form.varName") and len(form.varName)>
do something
</cfif>
isdefined() just looks for the variable name in the all variable type scopes
unless specified like isdefined("session.varName")
Joe
-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 25, 2002 8:23 PM
To: CF-Talk
Subject: isDefined question
is
<cfif isDefined("MyVariable")>
Yes i am defined
</cfif>
better/faster than or do the same thing as
(if you know the variable is defined) also
if you dont know the variable is defined.
<cfif Len(#MyVariable#)>
Yes i am defined
</cfif>
i guess my 2nd question, is this...Does the isDefined("")
look for something that is of a value greater than 1 Len()
or should/would an empty variable (a form field that hasnt
had anything typed in it), pass the isDefined("")
test?
just wondering ;)
..tony
tony weeg
[EMAIL PROTECTED]
www.revolutionwebdesign.com
rEvOlUtIoN wEb DeSiGn
410.334.6331
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists