> For the record:
> You can use more than one symbol for a list delimiter if you
> assign it to a variable first:
>
> <cfset delim = "||*||">
> <cfloop list="#list#" delimiter="#delim#".....
>
> Don't ask why, it just works that way
This really depends on what you mean by "using more than one symbol for a
list delimiter".
If you mean that you can use a multi-character string as a list delimiter,
this is not the case.
If, on the other hand, you mean that you can specify multiple characters,
any one of which may be used as a delimiter, you don't need to assign those
characters to a variable first.
Here's a code sample that demonstrates both of these points. Both CFLOOPs
will output the same thing - the numbers 1 through 4 on four separate lines.
If you could specify a multi-character delimiter, one or both CFLOOPs would
output "1:2" on the first line, then "3:4" on the second line. If assigining
the characters to a variable first made a difference, the first one would
output the numbers on four lines, and the second one would output two on
each line.
<cfset demolist = "1:2:;3;4">
<cfloop list="#demolist#" index="i" delimiters=":;">
<cfoutput>#i#</cfoutput><br>
</cfloop>
<br>
<cfset mydelims = ":;">
<cfloop list="#demolist#" index="i" delimiters="#mydelims#">
<cfoutput>#i#</cfoutput><br>
</cfloop>
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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