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

setVariable 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


Set the value of a from 1 to 2

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

Expected Result: 2


Fork me on GitHub