$skipActions
Skips a specified number of subsequent actions in the current execution block.
$skipActions[count]
$skipActions — Skip N Actions
$skipActions[count] causes the execution engine to bypass the next count actions. Unlike $stop which halts everything, $skipActions only jumps forward a set number of steps and then resumes normal execution. Think of it as a “fast-forward” button for your action sequence.
How It Works
When the runtime encounters $skipActions[count]:
- The
countparameter is resolved (it can be a literal, variable, or expression). - The execution pointer advances by
countpositions in the current action list. - Any actions between
$skipActionsand the target are completely bypassed. - Execution resumes normally after the skipped actions.
Actions are counted within the current execution block. Nested blocks (inside $if, $for, or $try) have their own action indexing, and $skipActions only affects the immediate enclosing block.
Count Resolution
The count argument is resolved at runtime as a string and then coerced to an integer:
$skipActions[3]— skips 3 actions.$skipActions[$getUserVar[n]]— skips the number of actions stored in variablen.$skipActions[$sum[$getUserVar[a];$getUserVar[b]]]— skips a computed amount.
If count resolves to a non-numeric value or an integer less than 0, behavior is undefined — typically no actions are skipped or an error is raised.
Use Cases
- Role-based access control: Skip admin-only actions for regular users.
- Feature flags: Skip experimental feature blocks when a flag is disabled.
- Error recovery: Skip a block of actions that depend on a failed prerequisite.
- Loop control: Skip processing for certain iterations without breaking the loop.
$skipActions vs $stop
| $skipActions[n] | $stop |
|---|---|
Skips exactly n actions, then resumes |
Halts all execution |
| Reversible effect (execution continues) | Permanent halt |
| Count can be dynamic | No arguments |
| Only affects the current block’s action list | Affects the entire pipeline |
Interaction with Structural Blocks
- Inside
$if:$skipActionsonly affects actions within the current branch. It does not skip past$elseIf,$else, or$endif. - Inside
$for: Actions skipped count toward the current iteration only. The loop still proceeds to the next iteration. - Inside
$try: Skipping in the$trybody may cause the$catchto be skipped if all remaining actions are bypassed and no error was raised.
Common Pitfalls
- Skipping past block terminators: If you
$skipActionspast an$endifor$endFor, you may get a parse or runtime error. Always ensure your skip count is within the current block’s boundaries. - Over-skipping: Skipping more actions than remain the block causes execution to move to the next sibling block — behavior that may be unexpected.
- Readability: Heavy use of
$skipActionscan make action sequences hard to follow. Prefer$ifblocks for conditional execution when possible.