Promotic

Remove - method of the PmaSequencer object

Description:
Removes waiting items.
Syntax:
Variant Remove(Long CheckType, [Variant CheckVal], [String Params])
Parameters:
CheckType(Long) Specifies what waiting items have to be removed
0 - remove all items (in this case the CheckVal parameter has no meaning)
1 (2,3,4,5) - remove items that meet: Val1 (2,3,4,5) = CheckVal
10 - remove only the first item from the queue (in this case the CheckVal parameter has no meaning)
11 (12,13,14,15) - remove only the first item from the queue that meets: Val1 (2,3,4,5) = CheckVal
CheckVal[optional] (Variant) compared value, see the CheckType parameter
Params[optional] (String) Additional parameters of the method. Entries are in the KeyVal format, for example return:count;.
"return:xxx;" - Specifies what will be returned by the method.
"return:count;" (default) - Returns the number of deleted items.
"return:values;" - Returns 2-dimensional array PmArray with values Val1, Val2, Val3, Val4, Val5 for each item.
The array will be in the format (Col,Row) - 2-dimensional array meaning an array of rows, where Col are Val1, Val2, Val3, Val4, Val5 and Row are the individual items removed.
If no items are removed, then the method returns: null for JavaScript or Empty for VBScript (it can be tested by the Pm.IsValid method). Translated with www.DeepL.com/Translator (free version)
Return value:
Returns the number of removed items or an array with the values of the removed items
Note:
The method removes the selected items from the waiting items queue. The removal means that the item is deleted without triggering the onStep event.
See also:
- PmaSequencer.Add (method)
Example1:
Removes all items from the queue
JavaScriptVBScriptSelect and copy to clipboard

var oSequencer = pMe.Pm("/Sequencer");
oSequencer.Remove(0);
Example2:
Removes all items from the queue that have the value Val1 = "ID1"
JavaScriptVBScriptSelect and copy to clipboard

var oSequencer = pMe.Pm("/Sequencer");
oSequencer.Remove(1, "ID1");
Example3:
Detects the values of Val1, Val2, Val3, Val4, Val5 of the items being removed
JavaScriptSelect and copy to clipboard

var oSequencer = pMe.Pm("/Sequencer");
var aRemoved = oSequencer.Remove(1, 100, "return:values;");
// 1030 = PmArray
if (Pm.GetVarType(aRemoved, 2) == 1030 && aRemoved.GetSize(1) == 5)
{
var nItem = aRemoved.GetSize(2);
for (iItem = 0; iItem < nItem; iItem++)
{
var val1 = aRemoved.GetItem(0, iItem);
var val2 = aRemoved.GetItem(1, iItem);
var val3 = aRemoved.GetItem(2, iItem);
var val4 = aRemoved.GetItem(3, iItem);
var val5 = aRemoved.GetItem(4, iItem);
Pm.Debug("val1 = " + val1 + ", val2 = " + val2 + ", val3 = " + val3 + ", val4 = " + val4 + ", val5 = " + val5);
}
}

History:
Pm9.00.25:
- New option "return:xxx;" allows to specify, whether the method returns the number of removed items or an array of removed item values.
- New options 4, 5, 14, 15 of the CheckType parameter.
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

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