On 12/8/06, Adam Cameron <[EMAIL PROTECTED]> wrote: > > > Presume you mean: > isdefined("session.crap)" (note: quotes)?
lol most peoples brains won't throw errors to pseudo code. isdefined(session.crap) will return true isdefined(crap) should be true structKeyExists(session, "crap") should be false structKeyExists(session.session.session, "crap") should return true. now the above will find the correct variable where as isdefined(" session.crap) could find an incorrect variable You can see there is a diff if you have 2 vars session.session.crap and session.session.session.crap in the one page. structkeyexists will check and see if there var is there and thats it, where as old mate isdefined will go looking through all the structs to see if it can find some crap anywhere. M@ I tried this code: > > <cfapplication name="testIsDefined" sessionmanagement="true"> > > <cfset session.session.session.crap = 1> > <cfoutput> > structKeyExists(session, "crap"): #structKeyExists(session, "crap")#<br > /> > isDefined(session.crap): > <cftry>#isDefined(session.crap)#<cfcatch>Didn't think that one would > work too well [#cfcatch.message#] ;-)</cfcatch></cftry><br /> > isDefined("session.crap"): #isDefined("session.crap")#<br /> > </cfoutput> > > And it did this: > structKeyExists(session, "crap"): NO > isDefined(session.crap): Didn't think that one would work too well > [Element CRAP is undefined in SESSION.] ;-) > isDefined("session.crap"): NO > > > Which is what I'd expect. > > CFMX: 7,0,2,142559 & 6,1,0,63958 > > -- > Adam > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---