Hello -
I am attempting to translate the following code into CF:
counter = 0
do while not returnedRecs.eof
if counter = 0 then
firstID = returnedRecs("listing_id")
firstAddress = returnedRecs("address")
elseif counter= 1 then
secondID = returnedRecs("listing_id")
secondAddress = returnedRecs("address")
elseif counter = 2 then
thirdID = returnedRecs("listing_id")
thirdAddress = returnedRecs("address")
elseif counter = 3 then
fourthID = returnedRecs("listing_id")
fourthAddress = returnedRecs("address")
elseif counter = 4 then
fifthID = returnedRecs("listing_id")
fifthAddress = returnedRecs("address")
elseif counter = 5 then
sixthID = returnedRecs("listing_id")
sixthAddress = returnedRecs("address")
elseif counter = 6 then
seventhID = returnedRecs("listing_id")
seventhAddress = returnedRecs("address")
elseif counter = 7 then
eighthID = returnedRecs("listing_id")
eighthAddress = returnedRecs("address")
elseif counter = 8 then
ninethID = returnedRecs("listing_id")
ninethAddress = returnedRecs("address")
else
tenthID = returnedRecs("listing_id")
tenthAddress = returnedRecs("address")
end if
counter = counter + 1
returnedRecs.movenext
loop
%>
I believe the code is assigning variables values from the database.
I think the way to translate this is:
<cfif qGetProperties.recordCount EQ 0>
<cfset firstID = #listingID#>
<cfelseif>...
</cfif>
and so on...
Am I on the right track?
Thanks in advance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5019
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm