reconsider the way you create those variables.  How are "RM1DAY" and the
other variables getting created?  A struct or an array would probably work
very nicely to store those variable values differently and speed up your
code.


Also, it's generally a very bad idea to put a query inside a loop.  Of all
the times I've seen someone do that, over 90% of them could have been
avoided by structuring the logic differently.


+-----------------------------------------------+
Bryan Love
  Database Analyst
  Macromedia Certified Professional
  Internet Application Developer
TeleCommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
        - Thomas Paine, The American Crisis

"Let's Roll"
        - Todd Beamer, Flight 93

-----Original Message-----
From: Jim Louis [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 12, 2004 9:47 AM
To: CF-Talk
Subject: getting rid of Evaluate in CF 5.0

I have a complex page that I use this system right now.  This is  a sample
of the text.

<CFIF Query.DATE EQ #Query2.DATE1#>
<CFSET A1=1>
<CFLOOP INDEX="Date1" FROM="#Starting#" TO="#Ending#">
<!--- No Roommates --->
<cfif (EVALUATE("RM1DAY" &A1) is '0') and (EVALUATE("RM2DAY" &A1) is '0')
and (EVALUATE("RM3DAY" &A1) is '0')>

<CFQUERY DATASOURCE="#db#" NAME="Update">
UPDATE table
  SET Day#a1# = 1
        WHERE ID = #query3.New_ID#
</CFQUERY>

<CFSET NEW_TOTAL = EVALUATE("query1.DAY" &A1) + 1>

<CFQUERY DATASOURCE="#db#" NAME="UpdateHotel">
UPDATE table2
       SET day#a1# = #new_total#
      WHERE ID = #query.H_ID#
</CFQUERY>
</cfif>

More code
<CFSET A1=A1+1>
</cfloop>

Is there any what to get rid of all of these evaluate tags.
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to