ScriptTap
ArraySegmentScan

Command video guide

ArraySegmentScan

ArraySegmentScan examines a selected array section and provides results for later commands. This Overview explains all eight modes without running a script. The separate guide tabs retain the shared setup and real-time examples.

Choose the array letter, its value type, a one-based Start index and Length. Supported types are Integer, Decimal, Boolean, Hex, String and Time. Forward or Reverse chooses ordinary scan direction. Empty Value is a typed sentinel, not an undeclared slot.

First Non-Empty finds the first value different from Empty Value. First Empty finds the first value equal to it. First Equal finds a target value; Count Equal counts all target matches. These Equal modes require a literal or compatible prior-variable match. Count Non-Empty counts values different from Empty Value.

Run Equal finds the first non-empty run when Match is None, or a run equal to an explicit literal/variable target. Run Boundary identifies contiguous matching runs after mask filtering: outputs can provide selected-run first/last indexes, selected length and total matching-run count. Scan direction selects the run; boundary indexes remain in natural array order.

Aggregate groups equal keys other than Empty Value, scanning forward in first-seen key order. It writes Integer counts to Count Array; optional Key Output writes distinct keys, and optional Sum uses corresponding Integer/Decimal source values and an appropriate sum output array. Max Groups bounds the number of groups. See the Aggregate guide for a complete counts, keys and sums example.

Available outputs depend on the selected mode. Use compatible destination variables and enable only needed outputs. An optional Boolean Active Mask filters eligible entries. A deliberate mode change clears outgoing mode-specific choices; ordinary output toggles preserve dormant destinations. Start with Intro & First Non-Empty for the shared data setup and a visible result.

Overview

Step-by-step guide

  1. Step 01

    Array Segment Scan examines a chosen part of an array and gives later commands useful results: positions, values, counts, runs, or grouped totals. This overview explains its eight modes and where to select them, without running a demonstration.

    ArraySegmentScan: Overview step 1: Array Segment Scan examines a chosen part of an array and gives later commands useful results: positions, values, counts, runs, or grouped totals. This overview explains its eight modes and where to select them, without running a demonstration.
  2. Step 02

    Drag Array Segment Scan from the Advanced group into the script, then open the new row. Use the separate demonstration tabs when you are ready to build a working example.

    ArraySegmentScan: Overview step 2: Drag Array Segment Scan from the Advanced group into the script, then open the new row. Use the separate demonstration tabs when you are ready to build a working example.
  3. Step 03

    Choose the array letter and its value type, then set the starting index and length of the section to examine. Indexes start at one. The value type can be Integer, Decimal, Boolean, Hex, String, or Time. Forward and Reverse choose the scan direction.

    ArraySegmentScan: Overview step 3: Choose the array letter and its value type, then set the starting index and length of the section to examine. Indexes start at one. The value type can be Integer, Decimal, Boolean, Hex, String, or Time. Forward and Reverse choose the scan direction.
  4. Step 04

    Open Mode to see the eight operations. These are different jobs, not Basic and Advanced versions of the command. An Empty Value defines which value should count as empty; it does not mean the slot is missing from the array.

    ArraySegmentScan: Overview step 4: Open Mode to see the eight operations. These are different jobs, not Basic and Advanced versions of the command. An Empty Value defines which value should count as empty; it does not mean the slot is missing from the array.
  5. Step 05

    First Non-Empty finds the first value that differs from the configured empty value. Use it to locate the next occupied slot in the selected section. Scan direction determines which eligible slot is encountered first.

    ArraySegmentScan: Overview step 5: First Non-Empty finds the first value that differs from the configured empty value. Use it to locate the next occupied slot in the selected section. Scan direction determines which eligible slot is encountered first.
  6. Step 06

    First Empty does the opposite: it finds the first value equal to the empty value. This is useful when looking for an available slot. It searches only the section you selected.

    ArraySegmentScan: Overview step 6: First Empty does the opposite: it finds the first value equal to the empty value. This is useful when looking for an available slot. It searches only the section you selected.
  7. Step 07

    First Equal searches for the first value matching a specific target. The match can be a literal value or a value from an existing compatible variable. Use this when you need the position of a particular item.

    ArraySegmentScan: Overview step 7: First Equal searches for the first value matching a specific target. The match can be a literal value or a value from an existing compatible variable. Use this when you need the position of a particular item.
  8. Step 08

    Count Equal counts matching values across the selected section instead of stopping at the first match. It also needs a literal or variable match value. Use its Count output when later decisions depend on how many matches exist.

    ArraySegmentScan: Overview step 8: Count Equal counts matching values across the selected section instead of stopping at the first match. It also needs a literal or variable match value. Use its Count output when later decisions depend on how many matches exist.
  9. Step 09

    Count Non-Empty counts all values that differ from the empty value. Use it to measure how many slots are occupied in the selected section, without having to write a loop to count them yourself.

    ArraySegmentScan: Overview step 9: Count Non-Empty counts all values that differ from the empty value. Use it to measure how many slots are occupied in the selected section, without having to write a loop to count them yourself.
  10. Step 10

    Run Equal finds a consecutive run. With no explicit match, it looks for the first non-empty run. With a literal or variable match, it looks for a run equal to that target. This is useful for recognizing consecutive matching entries.

    ArraySegmentScan: Overview step 10: Run Equal finds a consecutive run. With no explicit match, it looks for the first non-empty run. With a literal or variable match, it looks for a run equal to that target. This is useful for recognizing consecutive matching entries.
  11. Step 11

    Run Boundary describes a selected contiguous matching run. Its outputs can provide the first and last indexes, the run length, and the total number of matching runs. Direction chooses the run; boundary indexes still use the array's natural order.

    ArraySegmentScan: Overview step 11: Run Boundary describes a selected contiguous matching run. Its outputs can provide the first and last indexes, the run length, and the total number of matching runs. Direction chooses the run; boundary indexes still use the array's natural order.
  12. Step 12

    Aggregate groups equal non-empty keys and writes a count for each group to an Integer array. Optional Key Output also writes the distinct keys. Optional Sum adds corresponding numeric values from another array. Groups follow their first appearance, scanning forward.

    ArraySegmentScan: Overview step 12: Aggregate groups equal non-empty keys and writes a count for each group to an Integer array. Optional Key Output also writes the distinct keys. Optional Sum adds corresponding numeric values from another array. Groups follow their first appearance, scanning forward.
  13. Step 13

    Available outputs depend on the mode. Turn on only the results you need and give them compatible destination variables. An optional Boolean Active Mask can filter eligible entries. Switching modes clears outgoing mode-specific choices, so check the configuration again after a change.

    ArraySegmentScan: Overview step 13: Available outputs depend on the mode. Turn on only the results you need and give them compatible destination variables. An optional Boolean Active Mask can filter eligible entries. Switching modes clears outgoing mode-specific choices, so check the configuration again after a change.
  14. Step 14

    This overview stops without playing the script. Start with the Intro and First Non-Empty tab for the shared array setup and a visible result. The other guide tabs demonstrate individual operations with that setup.

    ArraySegmentScan: Overview step 14: This overview stops without playing the script. Start with the Intro and First Non-Empty tab for the shared array setup and a visible result. The other guide tabs demonstrate individual operations with that setup.