Skip to main content

1E 8.1 (on-premises)

Utilities.GenerateSequence

Module

Utilities

Method

GenerateSequence

Library

Core

Action

Build a sequence of numeric values, starting at 1 up to and including the value of a specified limit.

Parameters

Limit (integer): The upper bound of the sequence to generate. The range is 0 to 65535 inclusive. If 0 is specified then the resulting sequence will be empty.

Return values

For each numeric value between 1 and Limit inclusive:

  • Sequence (integer): The value in the sequence.

Example

Builds the numbers 1 to 10 inclusive, and then echoes back a message with the corresponding number into the results

FOREACH @i IN Utilities.GenerateSequence(Limit: 10)
DO
   @msg = SELECT "This is number " || @i.Sequence AS Message FROM @i;
   Agent.Echo(Message: @msg.Message);
DONE;

Platforms

  • Windows

  • Linux

  • MacOS

Notes

As per the example above, the GenerateSequence method can be useful to achieve FOR-loop-style behaviour using the FOREACH construct.