> Now please explain what it is that isDefined() does differently to
> structKeyExists() with regard to looking in implicit scopes.

structKeyExists() will only search the struct instance that is passed
in (once CF has established what that is - by doing an initial
variable lookup). If the key does not exist in that struct,
structKeyExists() stops and returns false.

isDefined() will search through various scopes - including CGI
scope(!) - to attempt to find something that matches.

Barney's example (variables.variables.test) is a good example of the
difference and therefore the additional work that isDefined() will do.

Because isDefined() can end up searching CGI scope, you can get
situations where an isDefined() call will initiate a callback from
ColdFusion to the web server through the web connector. Only a subset
of 'standard' CGI variables are passed directly to CF. Any subsequent
references to CGI.somevar cause a callback via the web connector to
see if the web server actually knows about somevar. It should be clear
that isDefined() can initiate such a reference...
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to