Erase
| Name |
Mandatory |
Description |
Default |
Type |
⬅️ Input |
|
Any input is ignored. |
|
Any |
Output ➡️ |
|
The input to this shard is passed through as its output. |
|
Any |
Indices |
No |
One or multiple indices to filter from a sequence. |
none |
AnyVar(Any) |
Name |
No |
The name of the variable. |
`` |
StringVar(Any) |
Key |
No |
The key of the value to erase from the table (nested table). |
none |
Any |
Global |
No |
If the variable is or should be available to all of the wires in the same mesh. |
false |
Bool |
Deletes an index or indices from a sequence or a key or keys from a table.
Examples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 | ; ; erase single element from sequence
[100 200 300 400] >= seq1
Erase([1] Name: seq1)
Log("output") ; ; => output: [100 200 300 400]
seq1 | Log("seq1") ; ; => seq1: [100, 300, 400]
; ; erase multiple elements from sequence
[100 200 300 400] >= seq2
Erase([2 0] Name: seq2)
seq2 | Log ; ; => [200, 400]
; ; erase single key-value pair from table
{k1: 10 k2: 20 k3: 30} >= tab1
Erase("k2" Name: tab1)
tab1 | Log ; ; => {k3: 30, k1: 10}
; ; erase multiple key-value pairs from table
{k1: 100 k2: 200 k3: 300} >= tab2
Erase(["k3" "k1"] tab2)
tab2 | Log
|