setVariable

Sets a variable in the name parameter to the value of the value parameter.

setVariable(name, value) → returns void

Discouraged: This function is no longer required in well-formed CFML pages

Argument Reference

name string
Required

Variable name

value string
Required

A string, the name of a string, or a number

Examples
Sample code invoking the setVariable function

a=1;
setVariable('a',2);
writeOutput(a);

Expected Result: 2

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub