structKeyExists() is preferrable over isDefined(). I believe the reason
cited was isDefined() is really parsing a string (the function's argument),
which is comparatively slower than structKeyExists() checking for a key in a
struct.
I've gotten into the structKeyExists() habit.
----- Original Message -----
From: "Philip Arnold" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, March 24, 2004 4:12 PM
Subject: RE: isDefined vs structKeyExists
> > From: Conan Saunders
> >
> > In CFMX 6.1, are these two functions completely equivalent,
> > or is there a difference?
> >
> > isDefined("APPLICATION.MyVar")
> >
> > structKeyExists(APPLICATION, "MyVar")
>
> It also depends on the name of the variable
>
> Take for example a variable named "_data"
> You cannot do:
> isDefined("application._data")
>
> But you can do:
> structKeyExists(application, "_data")
>
> Also, variables with spaces in them can't be done with isDefined()
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

