As Barney said they  are the same in most cases - but there is one caveat.
A "key" in a structure can actually contain a non-standard variable name
(for example foo['11234']).  Such a key name will evaluate as YES using
structkeyexists(foo,'1234') and throw an error for "isDefined('foo.1234')".
As it happens I wrote a blog just today on this very issue.

http://mkruger.cfwebtools.com/index.cfm?mode=alias&alias=isdefined%20vs%20st
ructkeyexists

-Mark



-----Original Message-----
From: Matthew Blatchley [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 08, 2005 4:50 PM
To: CF-Talk
Subject: Re: Simple CFC quesiton


Is this structKeyExists(arguments, "imageName") the same as
IsDefined("ARGUMENTS.imageName")?

----- Original Message -----
From: "Barney Boisvert" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Thursday, September 08, 2005 3:41 PM
Subject: Re: Simple CFC quesiton


> You should never* be referring to the form scope in a CFC.  You should
> be doing structKeyExists(arguments, "imageName") and if that returns
> true, then use it.  If it returns false, you don't have the variable
> to work with (regardless of whether it happens to exist in the 'form'
> scope).  If it does exist in form, not in arguments, and you NEED to
> have it, then it should be passed into the method.
>
> cheers,
> barneyb
>
> * blah blah blah, never is never accurate, there are always exceptions.
>
> On 9/8/05, Matthew Blatchley <[EMAIL PROTECTED]> wrote:
>> When using arguments that are not required:
>>
>> <cfargument name="imageName" type="string" required="no">
>>
>> Why do we refer to the argument as #form.imageName# instead of
>> #ARGUMENTS.imageName#, or does it not matter?
>>
>> Matt
>>
>
> --
> Barney Boisvert
> [EMAIL PROTECTED]
> 360.319.6145
> http://www.barneyb.com/
>
> Got Gmail? I have 100 invites.
>
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217720
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to