I want to loop over a structure and output something for all items except the last one. For arrays this can easily be done by checking whether the current index is the last one, though how to do it for structures?
Example code:
<cfscript>
myStruct = {
item1 = "foo",
item2 = "bar",
item3 = "baz"
};
</cfscript>
<cfoutput>
<cfloop collection="#myStruct#" item="item">
#myStruct[item]#
<!--- Here should be the conditional output --->
</cfloop>
</cfoutput>