AutomationView Documentation

LEN (String Length)

Measures the character length of an input string (IN) and writes the count to the target INT variable.


Description

LEN returns the number of characters in src (IN). It is commonly paired with MID to iterate through multi-operation command strings character by character (1..{len}).


Syntax

Sequence Visual Editor

  1. Select an action on a step or transition and hold Alt (or right-click -> Edit Qualifier & Instruction).
  2. Select Strings -> LEN and choose the P qualifier.
  3. Set the target INT variable and the source STRING operand (IN).

Action code_length with the P qualifier and the LEN instruction reading barcode
The result is the number of characters of the operand.

Python

from automation_machine import ActionQualifier, ActionInstruction

step.add_action("{len}", "Get command length", qualifier=ActionQualifier.P, instruction=ActionInstruction.LEN, src="{cmd}")

See Also