SetSize - method of the PmBuffer object

Setting the data block size.
Empty SetSize(Long nNewSize, [Boolean bRealloc])
nNewSize(Long) New data block size
bRealloc[optional](Boolean) Specifies the behavior when the size of existing data block is changed.
false (default) - The content of existing data block will not be preserved. New data block will be created and zeroed.
true - The content of existing data block will be preserved. The existing data blog will be enlarged or reduced in size. Only the modified portion will be zeroed.
This method is also functional in Web panels.
See also:
- PmBuffer.GetSize (method)
JavaScriptSelect and copy to clipboard

var oBuf = Pm.CreatePmBuffer();
var s1 = "40302010605070";
oBuf.SetHexaString(-2, s1);
var nSize = oBuf.GetSize();   // nSize = 7

oBuf.SetSize(nSize -2, true);
var val = oBuf.GetHexaString();   // val = 4030201060

Pm9.00.04: Created
PROMOTIC 9.0.21 SCADA system documentation - MICROSYS, spol. s r.o.

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