> CF syntax?
There are numerous examples of doing that in MX. Another favourite of
mine is when looping through a query, you can use myQuery.last() to
check if the item you're on is the last record rather than setting an
external counter etc.
For example, if I want to output a query as a list (yes, before anyone
says, I know I can use valuelist() - it's just an example!):
<!--- before java cleverness --->
<cfset myCounter = 0>
<cfloop query="myQuery">
<cfset myCounter = myCounter + 1>
<cfoutput>#myQuery.fieldname#<cfif myCounter LT myQuery.currentrow>,
</cfif></cfoutput>
</cfloop>
<!--- after java cleverness --->
<cfloop query="myQuery">
<cfoutput>#myQuery.fieldname#<cfif NOT myQuery.last()>,
</cfif></cfoutput>
</cfloop>
> Can you do a join to get the array back to a list?
You can just use the normal CF arraytolist() function to do that - note
that doing this will *include* empty array cells, so you can end up with
a list (string) that looks like: 1,2,3,,4,,,5,6
Tim.
--
-------------------------------------------------------
RAWNET LTD - Internet, New Media and ebusiness Gurus.
WE'VE MOVED - for our new address, please visit our
website at http://www.rawnet.com/ or call us any time
on 0800 294 24 24.
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential. If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
-------------------------------------------------------
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

