Update cookies preferences
Promotic

Remove - method of the PmArray object

Description:
Removes one or more items/rows from the array. The array is reduced by the removed items/rows.
Syntax:
Empty Remove(Long nPos, [Long nCount])
Parameters:
nPos(Long) The index of removed item/row.
The -2 value represents the last item.
nCount[optional] (Long) The number of items/rows to be removed.
If not set, then is 1.
The items/rows are being removed from defined position towards the end of the array.
If the last position of the array is set (-2) then the items/rows are being removed from the end of the array towards the beginning.
Either all selected items are removed successfully or the method fails.
Note:
For 2-dimensional arrays, it is necessary to follow the principle of correct order of array dimensions (columns, rows) see (Col,Row) - 2-dimensional array meaning an array of rows.

This method is also functional in Web panels.
Example1:
Removes 2 items from the array.
JavaScriptSelect and copy to clipboard

var aVal = Pm.CreatePmArray().Array1(0, 10, 20, 30, 40);
aVal.Remove(2, 2);   // Result: (0, 10, 40)
// or
aVal.Remove(-2, 2);   // Result: (0, 10, 20)
Example2:
Removes empty items from the array.
JavaScriptSelect and copy to clipboard

var aVal = Pm.CreatePmArray();
var n = 100;
aVal.Create(n);
aVal.SetItem("Test1", 0);
aVal.SetItem("Test2", 1);
aVal.Remove(2, n - 2);

History:
Pm9.00.29: Added support for deleting rows in 2-dimensional array.
Pm9.00.04: Created
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.