Hi all,
I,m not sure if you can nest cfloop but I'm not getting any errors
but the desired result is not working.
This is my code,
<cfloop index="item" list="#form.callsign#">
<cfquery name="qry_getvehicle" datasource="#application.dsn#"
username="#application.gateway#" password="#application.key#">
SELECT callsign, vowner, dt, Lat, Lon, Speed, Direction,
Veh_Reg
FROM dbo.vehicles
WHERE vowner = 224
</cfquery>
</cfloop>
<cfset start = 1>
<cfset max = qry_getvehicle.recordCount>
<cfparam name="icon" default="">
<cfloop index="Loopcount" from="#start#" to="#max#">
<cfif Loopcount eq max>
<cfset icon = "xhair">
<cfelse>
<cfset icon = "target">
</cfif>
<cfset allCars = "">
<cfloop query="qry_getvehicle" startrow="#start#"
endrow="#max#">
<cfif allCars neq "">
<cfset allCars = allCars & ";">
</cfif>
<cfset allCars = replace(allCars &
#qry_getvehicle.lon# & "," & #qry_getvehicle.lat# & ",#icon#," &
#qry_getvehicle.callsign#," ","","ALL")>
</cfloop>
</cfloop>
What I am trying to do is on the last loop set my icon to a crosshair image,
else set it to a target.
I thought by nesting my loop this would have worked. I suppose I should be
doing a 'while condition' within the cfloop instead, but I'm not too sure.
If anyone could help me on this I'd appreciate, thanx in advance..
JMC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists