From wiki.ginstr.com
Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
  
 
;Description: Action used to load value from target and stores it to variable.
 
;Description: Action used to load value from target and stores it to variable.
 +
:Copying data from source to target is done by reference, not by value.
 +
:Changing target value after copying might also affect source value. This is true for some [[Datatypes]], e.g. [[Datatypes#rows|rows]].
  
 
;Action returns: void
 
;Action returns: void
Line 10: Line 12:
 
===Load value to variable===
 
===Load value to variable===
  
;<code>[gn:act_setVariable]|[target,source]</code>
+
:;<code>[gn:act_setVariable]|[target,source]</code>
  
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
+
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
 
! scope="col" | Parameter
 
! scope="col" | Parameter
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| [[target]]
+
| <code>[[target]]</code>
 
| [[target]] where the value will be stored
 
| [[target]] where the value will be stored
 
* Valid [[target|targets]]:
 
* Valid [[target|targets]]:
** any [[:Category:variables|variable]]
+
** any [[:Category:Variables|variable]]
 
|-
 
|-
| [[source]]
+
| <code>[[source]]</code>
 
| [[source]] from where the value will be used
 
| [[source]] from where the value will be used
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
Line 30: Line 32:
  
 
====Example====
 
====Example====
<code>@variable/admin</code> - variable<br>
+
:<code>@variable/admin</code> - variable<br>
<code>true</code> - hardcoded value<br><br>
+
:<code>true</code> - hardcoded value<br>
<code>[gn:act_setVariable]|[@variable/admin,true]</code>
+
:; ⤷ <code>[gn:act_setVariable]|[@variable/admin,true]</code>
 
<hr>
 
<hr>

Latest revision as of 14:32, 8 August 2019

gn:act_setVariable

Description
Action used to load value from target and stores it to variable.
Copying data from source to target is done by reference, not by value.
Changing target value after copying might also affect source value. This is true for some Datatypes, e.g. rows.
Action returns
void

Action signatures

Load value to variable

[gn:act_setVariable]|[target,source]
Parameter Description
target target where the value will be stored
source source from where the value will be used

Example

@variable/admin - variable
true - hardcoded value
[gn:act_setVariable]|[@variable/admin,true]