Reverse Loop An Array of Structs

So I was trying to figure out how to loop an array of structs backwards. I found ways to loop arrays backwards but it only worked with using the reverse() function and that only works on a list of strings. Something that I was aware of until recently cfloop has a step attribute. So really it just came down like this, pretty simple:

view plain print about
1<cfloop from="#ArrayLen(ArrayofStructs)#" to="1" index="i" step="-1">
2 <cfdump var="#ArrayofStructs[i]#" abort="true" />

This is probably well known, but I wanted a reference so I can use it again later. Hope this helps someone.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Tony Nelson's Gravatar You forgot some #'s.
# Posted By Tony Nelson | 5/28/10 1:04 PM
Ryan Vikander's Gravatar Opps, the code has been fixed.
# Posted By Ryan Vikander | 5/28/10 1:09 PM
BlogCFC was created by Raymond Camden. This blog is running version Contact Blog Owner