Skip to content

Clear

Name Mandatory Description Default Type
⬅️ Input Any input is ignored. Any
Output ➡️ The input is passed through as the output. Any
Name No The name of the variable. `` String&Any
Key Yes 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

Clears all elements from the sequence or table passed to it. Applicable only to sequences and tables. For sequences, this operation is very fast as Shards recycles memory extensively. If the variable does not exist or the type is not a sequence or table, it simply passes through without failing.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
[1 2 3] >= seq ; ; create local sequence
seq | Log ; ; read local sequence  => [1, 2, 3]

Clear(Name: seq) ; ; clear local sequence
seq | Log ; ; local sequence cleared => []

100 | AppendTo(seq) ; ; append something to local sequence
seq | Log ; ; local sequence no more empty => [100]

Clear(Name: seq) ; ; clear
seq | Log