pjs.moveArray()
pjs.moveArray() moves elements from and/or to an array. If padding is specified, it will clear out the remaining characters and elements in the target after the move is complete.
Parameters
From array name
Target array name
From array index - 1 or higher, start from this index when working with the source.
Target array index - 1 or higher, start from this index when working with the target.
Padding (optional Boolean) - if passed in as true, the target will be padded.
Example
Example 1: array -> array
pjs.define("ARRX", { type: 'char', length: 5, dim: 5, initValue: 'Hi' });
pjs.define("ARRY", { type: 'char', length: 5, dim: 10, initValue: 'Test' });
pjs.MoveArray(ARRX, ARRY, 1, 1, false);
return ARRY;
//'Hi ','Hi ','Hi ','Hi ','Hi ','Test ','Test ','Test ','Test ','Test '
Example 2: char -> array
pjs.define("CHAR", { type: 'char', length: 5, initValue: 'Hello' });
pjs.define("ARRY", { type: 'char', length: 1, dim: 10 });
pjs.MoveArray(CHAR, ARRY, 1, 1);
return ARRY;
//'H','e','l','l','o',' ',' ',' ',' ',' '
Example 3: array -> array (with source index)
In this example, we are moving ARRX into ARRY. Since the second parameter is 3, this means it will start the move from the 3rd element (skipping the first two) which results in only 3 elements being moved.
Some documentation pages have recently moved to a new section: Profound AppDev. If you are having trouble finding specific pages, try the documentation search capability or reach out to our Support team!