Skip to content

Sub

Name Mandatory Description Default Type
⬅️ Input The value or the sequence of values to subtract the value specified in the Operand parameter from. IntInt2Int3Int4Int8Int16FloatFloat2Float3Float4Color[Any]
Output ➡️ This shard outputs the result of the subtraction. IntInt2Int3Int4Int8Int16FloatFloat2Float3Float4Color[Any]
Operand No The value or sequence of values to subtract from the input. 0 IntVar(Int)Int2Var(Int2)Int3Var(Int3)Int4Var(Int4)Int8Var(Int8)Int16Var(Int16)FloatVar(Float)Float2Var(Float2)Float3Var(Float3)Float4Var(Float4)ColorVar(Color)[Any]Var([Any])

This shard subtracts the value provided in the Operand parameter from the input value.

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
; _SubFlow container shard + nesting
5 | Log("input to Sub1") ; => 5

{
  Math.Multiply(2)
  Assert.Is(10 Break: true)
  Log("Sub1 inner shard o/p | 5 * 2") ; => 10
}

Log("Sub1 output => input to Sub2") ; => 5

{
  Math.Multiply(3)
  Assert.Is(15 Break: true)
  Log("Sub2 inner shard o/p | 5 * 3") ; => 15
  Log("input to nested-_SubFlow") ; => 15

  {
    Math.Multiply(2)
    Assert.Is(30 Break: true)
    Log("nested-_SubFlow inner shard o/p | (5 * 3) * 2") ; => 30
  }

  Log("output from nested _SubFlow") ; => 15
}

Log("Sub2 output => output") ; => 5

; Using Sub, with multiple operations
5 ; input to Sub shards
{
  Math.Multiply(2)
  Log ; 5 * 2 => 10
}

{
  Math.Multiply(3)
  Log ; 5 * 3 => 15
  {
    Math.Multiply(2)
    Log ; 15 * 2 => 30
  }
}

Log("output of the last Sub shard") ; input is output => 5

[info] [sample-wire] input to Sub1: 5
[info] [sample-wire] Sub1 inner shard o/p | 5 * 2: 10
[info] [sample-wire] Sub1 output => input to Sub2: 5
[info] [sample-wire] Sub2 inner shard o/p | 5 * 3: 15
[info] [sample-wire] input to nested-_SubFlow: 15
[info] [sample-wire] nested-_SubFlow inner shard o/p | (5 * 3) * 2: 30
[info] [sample-wire] output from nested _SubFlow: 15
[info] [sample-wire] Sub2 output => output: 5
[info] [sample-wire] 10
[info] [sample-wire] 15
[info] [sample-wire] 30
[info] [sample-wire] output of the last Sub shard: 5