I'm extracting results from a table, over a range of weeks, based on the
date range and a pair of values for each range.
The pair values are static, but the dates aren't. I'm looping over the
dates and values to dynamically build a table.
Here's what I've got so far... it works but it's not elegant and it's way
slow.
<!--- This creates the date range -->
<cfset dtStart = "03/12/2007">
<cfset dtEnd=#Now()#>
<cfscript>
eSearch = 0;
aSearch = 0;
cfSearch = 0;
sResults = 0;
AI = 0;
JI = 0;
Th = 0;
RecDisp = 0;
Browse = 0;
ML = 0;
rSearch = 0;
MPN = 0;
crSearch = 0;
FTC = 0;
OT = 0;
</cfscript>
<table border="1" valign="top" align="center" BORDERCOLOR="Black">
<tr>
<td bgcolor="##CCCCCC"
class="AddRemoveRows">Module</td>
<cfloop index="dtToday" from="#dtStart#"
to="#dtEnd#" step="#CreateTimeSpan( 7, 0, 0, 0 )#">
<cfset
hitDateStart=#DateFormat(dtToday, "mmm d yyyy")#>
<cfset
hitDateEnd=#DateFormat(DateAdd("ww", 1, "#hitDateStart#"), "mmm d yyyy")#>
<cfset dateStruct = StructNew()>
<cfset dateStruct.hitDateStart =
"#hitDateStart#">
<cfset dateStruct.hitDateEnd =
"#hitDateEnd#">
<cfoutput>
<td bgcolor="##CCCCCC"
class="AddRemoveRows">#hitDateStart# - #hitDateEnd#</td>
</cfoutput>
</cfloop>
</tr>
<!--- end date range --->
<!--- this queries the table based on the passed dates and a hard coded pair
of search values and builds the row --->
<tr>
<td bgcolor="##CCCCCC"
class="AddRemoveRows">Easy Search</td>
<cfloop index="dtToday" from="#dtStart#"
to="#dtEnd#" step="#CreateTimeSpan( 7, 0, 0, 0 )#">
<td class="AddRemoveRows">
<cfset
hitDateStart=#DateFormat(dtToday, "mmm d yyyy")#>
<cfset
hitDateEnd=#DateFormat(DateAdd("ww", 1, "#hitDateStart#"), "mmm d yyyy")#>
<cfset dateStruct = StructNew()>
<cfset dateStruct.hitDateStart =
"#hitDateStart#">
<cfset dateStruct.hitDateEnd =
"#hitDateEnd#">
<cfset dateStruct.HitCircuit =
"search">
<cfset dateStruct.HitFuseaction =
"easySearchForm">
<cfset TSHitDrillObj =
CreateObject("component", "actions.actrptdisplay")>
<cfinvoke component="#TSHitDrillObj#"
method="TimeSpanHitB" returnvariable="qTimeSpanhitDetail"
argumentcollection="#dateStruct#">
<cfloop query="qTimeSpanhitDetail">
<cfset eSearch = #eSearch# +
1>
</cfloop>
<cfoutput>#eSearch#</cfoutput>
</td>
</cfloop>
</tr>
I'm repeating this code block for each value pair, I want to use the block
once and loop over the dates and the value pairs.
Hope this makes sense
--
Scott Stewart
ColdFusion Developer
SSTWebworks
7241 Jillspring Ct.
Springfield, Va. 22152
(703) 220-2835
http://www.sstwebworks.com
-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Monday, April 09, 2007 9:39 AM
To: CF-Talk
Subject: RE: Structures
Okay...you could still put them into a structure if you want. What is it
that you're trying to accomplish?
-----Original Message-----
From: Scott Stewart [mailto:[EMAIL PROTECTED]
Sent: Monday, April 09, 2007 8:25 AM
To: CF-Talk
Subject: RE: Structures
No, "A" and "B" are separate values.
sas
--
Scott Stewart
ColdFusion Developer
SSTWebworks
7241 Jillspring Ct.
Springfield, Va. 22152
(703) 220-2835
http://www.sstwebworks.com
-----Original Message-----
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Monday, April 09, 2007 9:19 AM
To: CF-Talk
Subject: RE: Structures
Possibly. Is "b" the value of "A"? If each item on the left is meant to be a
key with it's intended value on the right, then by all means. Put that bad
boy into a structure.
-----Original Message-----
From: Scott Stewart [mailto:[EMAIL PROTECTED]
Sent: Monday, April 09, 2007 8:12 AM
To: CF-Talk
Subject: Structures
Hey all,
I have series of values that looks like this (sort of)
A, b
C, d
E, f
G, h
Can I put this into a structure?
Thanks
sas
--
Scott Stewart
ColdFusion Developer
SSTWebworks
7241 Jillspring Ct.
Springfield, Va. 22152
(703) 220-2835
HYPERLINK "http://www.sstwebworks.com"http://www.sstwebworks.com
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.0.0/751 - Release Date: 4/7/2007
10:57 PM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274843
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4