> I would like to reference different scopes as I need to > because some objects are cached in the application scope and > other objects might be cached in session scope, etc. > > This work fine: > x = session["sessionId"]; > > but this does not work: > x = ["session"].sessionId;
There are two reasons why the second code snippet won't work. First, and most importantly, the Session scope is not a member of some other structure. The square bracket "array" syntax only allows you to access members of a structure. Second, that syntax only works with structure members if you specify the structure as well. So, even if you had a variable named "foo" that happened to be within the structure "bar" that itself was within another structure "baz", you couldn't talk about ["bar"].foo, only about baz["bar"].foo or baz.bar.foo or baz["bar"]["foo"]. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236639 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

