Hmm, lot's of things here, I'll comment in code.

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

If you are completely new to structures, your best bet is to read the
docs. For a quickie...

<cfset x = structNew()>
<cfset x.name = "raymond">
<cfoutput>#x.name# or #x["name"]#</cfoutput>

> <cfsetting enablecfoutputonly="Yes"> 
> <cflock timeout="15" scope="APPLICATION" type="EXCLUSIVE"> 
> <cfif NOT isDefined("Application.UsersInfo")>
> <CFSCRIPT>
> Application.UsersInfo = StructNew();
> </CFSCRIPT>
> </cfif> 
> </cflock>

First, if you are checking to see if Application.UsersInfo exists, I'd
use a read lock.

<cflock scope="application" type="readOnly" timeout=3>
        <cfif not isDefined("application.usersInfo")>
                <cfset variables.needInit = 1>
        </cfif>
</cflock>
<cfif isDefined("variables.needInit") and variables.needInit>
        <cflock scope="application" type="exclusive" timeout=3>
                <cfset application.usersInfo = structNew()>
        </cflock>
</cfif>

> <cflock name="UserInfo" timeout="15" type="EXCLUSIVE"> 
> <cfscript> 
> user_cfid = Evaluate(CFID); 

Why evaluate cfid? You don't need that.

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

No real need to use structInsert, I'd just do:

        applicaiton.usersinfo[user_cfid] = user_info;

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

Ack ack. No need for evaluate.

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


______________________________________________________________________
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