Set Variable: Difference between revisions
m
				
Add information, adapted from old wiki article
| Nikitaivanov (talk | contribs)  (Created page with "Stores the input value into a variable. Think of a variable as a container with a nametag that can only store one value at a time. If you were to set another value to a variable, it will overwrite the previous value of that variable.  File:Set_Variable1.png  You can get/output the value from a variable with the same name using the Get Variable block.  File:Screenshot_2021_1022_011555_com.martinmagni.fancade.png  == Global variables ==  Let's say you have a sc...") | -u ndefined- (talk | contribs)  m (Add information, adapted from old wiki article) | ||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| {{Block | |||
| |image=Set_Variable_number.png | |||
| |type=s | |||
| |folder=Variables | |||
| |input1={{Port|e|Before}} | |||
| |input2={{Port|?|Value}} | |||
| |output1={{Port|e|After}} | |||
| }} | |||
| Stores the input value into a variable. | |||
| See [[Variables]] for more information. | |||
| == Notes == | |||
| If {{Port|?|Value}} remains not wired, the variable will not be overwritten. | |||
| This could be used to provide default values for a custom script block: | |||
| [[File:Set_Variable_default_value.png|thumb|none|Demonstration applying a default value, 2. The variable is global for inspection.]] | |||
| == Related == | |||
| ==  | |||
| * [[Variables]] | |||
| * [[Get Variable]] | |||
| * [[List Element]] | |||
| * [[Set Reference]] | |||
| [[Category:Blocks]] | [[Category:Blocks]] | ||