Re: IsDefined and brackets

2002-04-19 Thread cf refactoring
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

IsDefined and brackets

2002-04-18 Thread cf refactoring
The following code throws a syntax error: cfset aStruct=StructNew() cfset aStruct.aField=something cfif IsDefined(aStruct[aField]) aStruct[aField] is defined /cfif Is this just some CF quirk that IsDefined doesn't like brackets or is there some good reason for this? = I-Lin Kuo

RE: IsDefined and brackets

2002-04-18 Thread Rob Baxter
and brackets The following code throws a syntax error: cfset aStruct=StructNew() cfset aStruct.aField=something cfif IsDefined(aStruct[aField]) aStruct[aField] is defined /cfif Is this just some CF quirk that IsDefined doesn't like brackets or is there some good reason for this? = I

Re: IsDefined and brackets

2002-04-18 Thread Douglas Brown
: Thursday, April 18, 2002 9:04 AM Subject: RE: IsDefined and brackets I believe that IsDefined is only meant to check for the existance of top level variables, for complex data types you have to use the specific functions for each type. So here CF is trying to find out if there is a variable

RE: IsDefined and brackets

2002-04-18 Thread Dave Watts
The following code throws a syntax error: cfset aStruct=StructNew() cfset aStruct.aField=something cfif IsDefined(aStruct[aField]) aStruct[aField] is defined /cfif Is this just some CF quirk that IsDefined doesn't like brackets or is there some good reason for this? You could

Re: IsDefined and brackets

2002-04-18 Thread Jamie Jackson
CF quirk that IsDefined doesn't like brackets or is there some good reason for this? = I-Lin Kuo Macromedia CF5 Advanced Developer Sun Certified Java 2 Programmer __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http

RE: IsDefined and brackets

2002-04-18 Thread Raymond Camden
PROTECTED] Yahoo IM : morpheus My ally is the Force, and a powerful ally it is. - Yoda -Original Message- From: cf refactoring [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 11:50 AM To: CF-Talk Subject: IsDefined and brackets The following code throws a syntax error

Re: IsDefined and brackets

2002-04-18 Thread stas
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,

Re: IsDefined and brackets

2002-04-18 Thread Jamie Jackson
() cfset aStruct.aField=something cfif IsDefined(aStruct[aField]) aStruct[aField] is defined /cfif Is this just some CF quirk that IsDefined doesn't like brackets or is there some good reason for this? = I-Lin Kuo Macromedia CF5 Advanced Developer Sun Certified Java 2 Programmer

RE: IsDefined and brackets

2002-04-18 Thread Dave Watts
Why not simply cfif isdefined(aStruct.aField) ? I implied in my original post that you could use dot notation, as opposed to array syntax. If you use dot notation, it's clear that you're referencing a variable within a structure, I suppose, which entails checking the existence of both the

Re: IsDefined and brackets

2002-04-18 Thread Douglas Brown
[EMAIL PROTECTED] Sent: Thursday, April 18, 2002 8:50 AM Subject: IsDefined and brackets The following code throws a syntax error: cfset aStruct=StructNew() cfset aStruct.aField=something cfif IsDefined(aStruct[aField]) aStruct[aField] is defined /cfif Is this just some CF quirk