I have code inside the loop since the loop repeats. I set a dynamic variable temp
to a value getAdvisor_Advisors.advisor_ID
for the current iteration of the loop.
<cfset temp = "getAdvisor_Advisors#LoopCount#.advisor_ID">
The cfinvoke below calls a request that I pass in the dynamic variable "temp", but must use a slow evaluation (temp) around it to get the correct value.
<cfinvoke component="com.appointments" method="get_All_Appointments" returnvariable="getAppointments">
<cfinvokeargument name="Advisor_ID" value="#evaluate(temp)#">
<cfinvokeargument name="StartDay" value="#dateFormat(form.cal,'dd')#">
<cfinvokeargument name="StartMonth" value="#dateFormat(form.cal,'mm')#">
<cfinvokeargument name="StartYear" value="#dateformat(form.cal,'yyyy')#">
</cfinvoke>
I want to rewrite the variable temp
and evaluate()
so as not to use the estimate. I am told that I can use the structure syntax to refer to it like the following:
No rating:
<cfset foo = qBar["text#lang#"][CurrentRow]>
getAdvisor_Advisor["advisor_ID"][CurrentRow]
How to rewrite
<cfset temp = "getAdvisor_Advisors#LoopCount#.advisor_ID">
using structure syntax?
Adding more code so you can understand why it is complicated, these are complex loops.
<cfquery name="getAdvisor_Advisors1" dbtype="query" cachedWithin="#CreateTimeSpan(0,0,15,0)#">
Select *
From getAdvisors
Where Express = 'FR/SO'
Order by Specialization, Advisor
</cfquery>
<cfquery name="getAdvisor_Advisors2" dbtype="query" cachedWithin="#CreateTimeSpan(0,0,15,0)#">
Select *
From getAdvisors
Where Express = 'JR/SR'
Order by Specialization, Advisor
</cfquery>
<cfquery name="getAdvisor_Advisors3" dbtype="query" cachedwithin="#CreateTimeSpan(0,0,15,0)#">
Select *
From getAdvisors
Where Specialization IS NULL AND Appointments = 1 AND Campus_ID > 0
Order by Campus_ID, Advisor
</cfquery>
<cfquery name="getAdvisor_Advisors4" dbtype="query" cachedwithin="#CreateTimeSpan(0,0,15,0)#">
Select *
From getAdvisors
Where Specialization IS NOT NULL
AND Title != 'BCC-GA'
Order by Specialization, Advisor
</cfquery>
<div id="calendarGrid">
<cfloop index="LoopCount" from = "1" to = "4">
<cfif LoopCount LTE 3>
<cfset currGroup = "campus_id">
<cfelse>
<cfset currGroup = "specialization">
</cfif>
<cfoutput query="getAdvisor_Advisors#LoopCount#" group="#currGroup#">
<div class="advisorGrouping">
<div id="calcontainer">
<table class="pickme" border="0" cellspacing="1" cellpadding="1">
<tr class="hdr">
<td width="6.9%">
<cfif (Specialization IS "BCC") OR (Specialization IS "HONORS")>
#uCase(Specialization)#
<cfelse>
#uCase(Campus_Text)#
<cfif Len(Express) NEQ 0>
- #uCase(Express)#
</cfif>
</cfif>
</td>
<td width="4.9%" class="border">8:00</td>
<td width="4.9%" class="border">8:30</td>
<td width="4.9%" class="border">9:00</td>
<td width="4.9%" class="border">9:30</td>
<td width="4.9%" class="border">10:00</td>
<td width="4.9%" class="border">10:30</td>
<td width="4.9%" class="border">11:00</td>
<td width="4.9%" class="border">11:30</td>
<td width="4.9%" class="border">12:00</td>
<td width="4.9%" class="border">12:30</td>
<td width="4.9%" class="border">1:00</td>
<td width="4.9%" class="border">1:30</td>
<td width="4.9%" class="border">2:00</td>
<td width="4.9%" class="border">2:30</td>
<td width="4.9%" class="border">3:00</td>
<td width="4.9%" class="border">3:30</td>
<td width="4.9%" class="border">4:00</td>
<td width="4.9%" class="border">4:30</td>
<td width="4.9%" class="border">5:00</td>
</tr>
<cfoutput group="advisor_id">
<cfset temp = "getAdvisor_Advisors#LoopCount#.advisor_ID">
<cfinvoke component="com.appointments" method="get_All_Appointments" returnvariable="getAppointments">
<cfinvokeargument name="Advisor_ID" value="#evaluate(temp)#">
<cfinvokeargument name="StartDay" value="#dateFormat(form.cal,'dd')#">
<cfinvokeargument name="StartMonth" value="#dateFormat(form.cal,'mm')#">
<cfinvokeargument name="StartYear" value="#dateformat(form.cal,'yyyy')#">
</cfinvoke>