ere is my code. What your saying is that I put an array inside of the
structure???

How would I get the data out if I did that???

<cfsetting enablecfoutputonly="Yes"> 
<cflock timeout="15" scope="APPLICATION" type="EXCLUSIVE"> 
<cfif NOT isDefined("Application.UsersInfo")>
<CFSCRIPT>
Application.UsersInfo = StructNew();
</CFSCRIPT>
</cfif> 
</cflock>
<cflock name="UserInfo" timeout="15" type="EXCLUSIVE"> 
<cfscript> 
user_cfid = Evaluate(CFID); 
user_info = Now(); 
user_Host = CGI.Remote_host; 
user_Addr = CGI.Remote_Addr; 
User_Browser = CGI.http_user_agent; 
</cfscript> 
</cflock> 
<cflock scope="APPLICATION" type="EXCLUSIVE" timeout="15"> 
<cfif NOT StructKeyExists(Application.UsersInfo, user_cfid)> 
<Cfscript> 
StructInsert(Application.UsersInfo, user_cfid, user_info);
</CFSCRIPT> 
</cfif> 
</cflock> 
<cflock scope="APPLICATION" type="EXCLUSIVE" timeout="15"> 
<cfloop collection="#Application.UsersInfo#" item="itmUser"> 
<cfif Evaluate(DateDiff("n", StructFind(Application.UsersInfo, itmUser),
Now())) GT 1> <CFSCRIPT> 
StructDelete(Application.UsersInfo, itmUser); 
</CFSCRIPT> 
</cfif> 
</cfloop> 
</cflock> 
<cfsetting enablecfoutputonly="NO">

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

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to