If variables.myField doesn't exist, then it'll search
form.variables.myField, or possibly form["variables.myField"], maybe even
both.  Same goes for url, and maybe even variables
(variables.variables.myField).  You'd have to write a little test to be
sure, but isDefined is definitely doing a LOT more work than
structKeyExists().

Cheers,
barneyb

> -----Original Message-----
> From: Matt Robertson [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 12, 2004 1:03 PM
> To: CF-Talk
> Subject: Re: StructKeyExists() vs IsDefined()
>
> Barney wrote:
> >isDefined(), on the other hand, looks in all the potential places
> > that the variable can exist.  So it'll check the variable
> as named, and then
> > for a variable with that name in all the implicit scopes.  
>
> What if you define the var explicitly?
>
> if (isdefined("variables.myField")) { variables.yadda=yaddayadda; }
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to