Promotic
WikipediaLinkedInYoutubeTwitterFacebook

SetSize - method of the PmBuffer object

Description:
Setting the data block size.
Syntax:
Empty SetSize(Long nNewSize, [Boolean bRealloc])
Parameters:
nNewSize(Long) New data block size
bRealloc[optional] (Boolean) Defines 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.
Note:
This method is also functional in Web panels.
See also:
- PmBuffer.GetSize (method)
Example:
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

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

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice