Skip to content

Get

Name Mandatory Description Default Type
⬅️ Input Any input is ignored. None
Output ➡️ The output is the value read from the specified variable. Any
Name No The name of the variable. `` StringVar(Any)
Key No The key of the value to read from the table (parameter applicable only if the target variable is a table). none Any
Global No If the variable is available to all of the wires in the same mesh. false Bool
Default No The default value used if the variable is not set, the key is not present, or there is a type mismatch. none Any

Reads the value of the specified variable.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
; ; create a mutable string variable and get its value
"Hello" | Set(Name: svar) ; ; set value
Get(Name: svar) = gotSvar ; ; get value and store it
gotSvar | Log("gotten value") ; ; => gotten value: Hello

; ; create an immutable numeric variable and get its value
100 | Ref(Name: nvar) ; ; set value
Get(Name: nvar) >= gotNvar ; ; modify numeric variable
gotNvar | Log("gotten value") ; ; => gotten value: 100

; ; create a mutable sequence and get it
[10 20 30] | Set(Name: sequence)
Get(sequence) | Log ; ; => [10, 20, 30]

; ; create an empty sequence and try reading it with the Default: failsafe
[] | Set(Name: seqEmpty)
Get(Name: seqEmpty Default: "Void") | Log ; ; => Void

; ; create a table and get one of it's key-values pairs
["a" "b"] | Set(Name: table Key: "key1")
Get(Name: table Key: "key1") | Log ; ; => [a, b]

; ; create a table and try to get a non-existent key-value using the Default: parameter
["a" "b"] | Set(Name: table Key: "key1")
Get(Name: table Key: "key2" Default: "Key missing") | Log