Ok so I inherited an application to update and I am trying to clean it
up a little bit,or maybe a lot, but I keep running into this:

<cfloop query="MyQuery">
   <cfset revBy=MyQuery.rev_by>
   <cfset revDt=MyQuery.rev_dt>
</cfloop>

why oh why would some one do this? Is there a good explanation? Since
the code is not commented I have no idea who the original author is so
I can't ask him/her.

At the very least wouldn't

<cfset revBy = MyQuery.rev_by[myquery.recordcount]>
<cfset rev_dt = MyQuery.rev_dt[myquery.recordcount]>

Get you to the sane place faster? Most of these queries I think are
only supposed to return one row but still I would think, especially on
CF 5 which is what this app is running on, the looping would be a
waste of time. Anyone's thoughts?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to