Tech Sharing

Tech Sharing


Looping through A to Z in ColdFusion

By on July 27, 2012

There are always more than single methods to accomplish the same job in programming language. To loop through the letters from A to Z in ColdFusion there are also more than one way, but I personally found out the following 2 methods are simpler and strain forward.


Hardcode the A to Z into a list and just loop over it






<cfdump var=”#strLetter#”>





The other way to loop through the letters is using the ASCII value from A to Z. We first convert the A and Z to ASCII, than just use the number to loop through the rest and convert it back to char to get back our result.




from=”#Asc( ‘A’ )#”

to=”#Asc( ‘Z’ )#”



<!— Get character of the given ascii value. —>

<cfset strLetter = Chr( intLetter ) />


<cfdump var=”#strLetter#”>




Please feel free to share the way you usually use or you may found out any other better way to do the job.

Website Pin Facebook Twitter Myspace Friendfeed Technorati Digg Google StumbleUpon Premium Responsive


No Responses to “Looping through A to Z in ColdFusion”

Write a Comment

Captcha * Time limit is exhausted. Please reload CAPTCHA.

%d bloggers like this: