Whats the advantage of using a structure of arrays??

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...

Eventually I want to try and duplicate the cunctionality of Groopz.com
by using CF & Java.. But I need to refine the session management piece
first

-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 09, 2002 10:02 AM
To: CF-Talk
Subject: RE: Array Help?


You don't have to do anything to increase x. If you want to find the
current length of Array, just use arraylen(). This code will add a new
array to the end of the existing array:

<cfset array = arrayNew(2)>

<!--- add 3 entries --->
<cfloop index="i" from=1 to=3>
        <cfset array[arrayLen(array)+1] = arrayNew(1)>
        <cfset array[arrayLen(array)][1] = "whatever">
        <cfset array[arrayLen(array)][2] = "whatever part 2 - the
sequel">
        <cfset array[arrayLen(array)][3] = "whatever part 3 - the hunt
for more money"> </cfloop>

CF let's you populate arrays without populating every entity. So you can
(but probably should not) do stuff like:

<cfset x = arrayNew(1)>
<cfset x[99] = "boo">

Now - you mention that you are trying to store information about active
sites. Maybe instead of a 2d array you should consider a struct of
arrays?

=======================================================================
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 

> -----Original Message-----
> From: Kris Pilles [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 09, 2002 9:53 AM
> To: CF-Talk
> Subject: Array Help?
> 
> 
> I need some help with 2-dimensional arrays.
> 
> Basically I want to have an array that dynamically adds and removes 
> information about my active sites sessions.
> 
> I understans how to get all the data, what I do not
> understand is how to
> Increacse the X in my array:
> 
> array[x][1]
> Array[x][2]
> Array[x][3]
> 
> Can soemone point me in the right direction...
> 
> 
> THanks
> 

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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

Reply via email to