Another good idea that I'll keep in my back pocket. I manipulate the array in 
later code in ways I couldn't do with this method, but still a useful thing to 
remember. Thanks. 


 

-----Original Message-----
From: Tom McNeer [mailto:[email protected]] 
Sent: Friday, February 05, 2010 9:43 AM
To: cf-talk
Subject: Re: Arrays - humbug! - Part 2


Larry,

Not sure exactly what you're going for. But rather than go into array usage 
(and looping a collection), which you can probably learn better elsewhere, 
maybe there's a simpler way to attack the problem.

In the end, you seem to simply want to go over a query result:

  <cfquery name="GetLats" datasource="#SESSION.ds#">
               SELECT tblLaterals.latID,
                               tblLaterals.lateralID,
                               tblLaterals.Why,
                               [FirstName] & Chr(32) & [LastName] AS Who,
                               tblPlayers.Title,
                               tblPlayers.TX,
                               tblPlayers.FAX,
                               tblPlayers.Email,
                               tblLaterals.DateSent
               FROM tblLaterals LEFT JOIN tblPlayers ON tblLaterals.lateralID = 
tblPlayers.playerID
               WHERE tblLaterals.MasterID=#SESSION.
Report.MasterID#
               ORDER BY [FirstName] & Chr(32) & [LastName];
  </cfquery>

... and output it onto the page. Now, I'm assuming that you're stuffing the 
results into the session scope because you need to use it more than one place. 
But I can't see why you need to create the array or do all that looping.

Can't you simply place the query result into the session scope:

<cfset session.Report.Lats = getLats />

... then output it on the page:

<cfif session.Report.Lats.recordCount GT 0>
    <cfoutput query="session.Report.Lats">

    ... and built your list item here.

   </cfoutput>
</cfif>

Or have I missed what you're going for?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330441
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to