How are you summing the data?  Is it coming from a query?  One of the hacks
I use quote a bit is basically a one-line QuerySum() function:

<CFSET Total=ArraySum(ListToArray(ValueList(Query.Column)))>

I tend to find it takes a fraction of the time that looping over the query
does.

If your situation is a bit more complex, you may want to consider using a
custom tag solution.  You could wrap the functionality in a custom tag and
then use ThisTag.GeneratedContent to delay writing the scores until after
you can prepend a header.

-R

-----Original Message-----
From: Won Lee [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 30, 2001 14:47
To: CF-Talk
Subject: Really delayed evaluation


Hi guys.

Was hoping that someone might know how to do this.

I have a survey-scoring module.
They want the ability for the scores to be dynamically displayed (meaning
the overall scores should not be scored).  Everything is ok except this.
Each survey has several categories.  Each category has a score that I
calculate.  They also want the overall score (the sum of every category
added up).  However they want this infomration on the top of the page.
However because the category scores are not calculated until the page is
being generated, I'm having problems displaying the overall score (sum of
call category scores) on the top.

Anyway to do this without having to do two loops?  I believe it would be a
horrible waste of system resources to have a loop to calculate the scores
first, then do a loop just to display the info.

Won

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.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

Reply via email to