Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following script extracts a set of values from a list or array of positive numbersvalues, to create a sublist.

Code Block
do(
  $list = $args[1],
  $firstInteger$startPosition = $args[2],
  $secondInteger$endPosition = $args[3],
  $subList = [],

  forEach($i,$firstInteger$startPosition..$secondInteger$endPosition,
    $subList = addElement($subList, getElement($list,$i)),
    _NULL
  ),

  $subList
)

The script does not handle zeros or negative numbers.

Using the Script as a Macro

...

Code Block
subList([value1, value2, value3,...], <startPosition>, <endPosition>)


ArgumentType
valuenA value of any type
startPositionInteger representing where to start extracting values.Cannot be zero or a negative number.
endPositionInteger representing where to stop extracting values. 

...