Thanks to everyone who replied. I knew I could use isdefined("aStruct.aField") but I was just wondering what the rationale was behind invalid syntax error for isdefined("aStruct['aField']"). Dave's explanation that I should really think of it as two separate tests was pretty good.
Also, I don't like to use isdefined("aStruct.aField") because sometimes I might have spaces in "aField" and that would cause IsDefined to choke, so StructKeyExists() is the way to go for me. --- stas <[EMAIL PROTECTED]> wrote: > Why not simply > > <cfif isdefined("aStruct.aField")> ? > > > ----- Original Message ----- > From: "Dave Watts" <[EMAIL PROTECTED]> > > You could rewrite this test to look like this: > > <cfif IsDefined("aStruct") and > StructKeyExists(aStruct, "aField")> > > This clearly describes the two tests you're running. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > voice: (202) 797-5496 > fax: (202) 797-5444 ===== I-Lin Kuo Macromedia CF5 Advanced Developer Sun Certified Java 2 Programmer __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ ______________________________________________________________________ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists