array.subarray()



Returns a subset of elements from an array.

Parameters
  1. Starting index

  2. Element count

Return Value

Array of elements that were retrieved from the parent array.

Example
pjs.define("a", { type: 'integer', dim: 5 }); pjs.define("resultArr", { type: 'integer', dim: 20 }); a[1] = 9; a[2] = 5; a[3] = 16; a[4] = 13; a[5] = 3; // Copy part of an array to another array: resultArr = a.subarray(4, 2);

RPG Equivalent

%SUBARR