cfdocs

setVariable

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

setVariable(name, value)
returns void

Argument Reference

Name Type Required Default Description
name string Yes   Variable name
value string Yes   A string, the name of a string, or a number

Set the value of a from 1 to 2

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

Expected Result: 2