SetVariable()
Sets a variable value, supports scoped variable syntax
SetVariable( name=string, value=any );
Returns: any
Argument | Description |
---|---|
name
string,
required
|
Name of the variable to set, allows using "." for structures/scopes. |
value
any,
required
|
the value to set |
Examples
str="hi buddy";
setVariable('str', "Value changed");
writeOutput(str);
<span class="nf">setVariable</span><span class="p">(</span><span class="s1">'session.AAA'</span><span class="p">,</span> <span class="s2">"Hello docs reader"</span><span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span><span class="nf">getVariable</span><span class="p">(</span><span class="s2">"session"</span><span class="p">));</span>
See also
- Scopes
- GetVariable()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)