The CFML SetVariable() function can be used to set variables, even variable names constructed dynamically – for example, if i were 2, SetVariable(“item” & i, 10) would set variable item2 to 10. But in newer versions of ColdFusion this function is not needed, can do the same thing and do it quicker too. To set the above example using you could use this code . (Applies to: ColdFusion 4.5 or later)

Leave a Reply