"Don't forget your cflocks if you aren't on cfmx." Does this mean, you dont need CFLOCKS in CFMX? if so... does Pre- CFMX code with CFLocks add overhead to CFMX CFAS?
Joe ----- Original Message ----- From: "Raymond Camden" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Friday, August 09, 2002 10:26 AM Subject: RE: Array Help? > > Whats the advantage of using a structure of arrays?? > > It may or may not be an advantage. When deciding what type of data > structure to use, you should always consider what your needs are. Ie, > how do you plan on storing and using the data. In general, I don't often > use 2d arrays because normally it makes more sense to use structures. > > > Initially I had my session infon in a structure. I was just tracking > > how many people were currently active on the site. But now, I want to > > expand on that and capture CFId, Remote ADDR, Remote Host, browser > > etc... > > Ah, in this case you want to store information about people, and store > all the people in one variable. If you have a unique ID for each person, > it would make more sense to use a structure that looked like so: > > people = structNew(); > people["Ray Camden"] = structNew(); > people["Ray Camden"].age = 29; > people["Ray Camden"].rank = "Captain"; > > If you are storing session info, you can easily use session.urltoken as > a primary key. If you want an easy way to copy session info to a > variable, consider duplicate: > > application.peopleData[session.urltoken] = duplicate(session) > > Don't forget your cflocks if you aren't on cfmx. > > Also do not forget that when a session expires, the data will still be > in the application scope. To get around this, you simply store the 'last > hit' info in the application variable as well. You can use another > structure as well: > > application.peopleData[session.urltoken] = duplicate(session) > application.peopleDataLastHit[session.urltoken] = now(); > > Then when displaying info about the users online, if the person's > "lastHit" value is older then your session timeout, you can remove them > from the peopleData structure. > > ======================================================================= > Raymond Camden, ColdFusion Jedi Master for Macromedia > > Email : [EMAIL PROTECTED] > Yahoo IM : cfjedimaster > > "My ally is the Force, and a powerful ally it is." - Yoda > > > ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

