Insert - method of the PmBuffer object

Inserts a new empty space inside an existing data block and enlarges the data block.
Long Insert(Long nOffset, Long nInsert)
nOffset(Long) Specifies the position in the data block where the new empty space is inserted.
>= 0 - Index (in bytes, zero-based index) in the data block.
-4 - The internal automatic position is used (see the AutoOffset property).
This operation shifts the internal automatic position to the beginning of the insertion..
nInsert(Long) The size of the inserted empty space in bytes.
Return value:
Returns the number of bytes inserted or 0 on error.
This method is not functional yet in Web panels.
See also:
- PmBuffer.SetSize (method)
- PmBuffer.Remove (method)
JavaScriptSelect and copy to clipboard

var b = Pm.CreatePmBuffer();
b.SetUint8(-2, 0x10);
b.SetUint8(-2, 0x20);
b.SetUint8(-2, 0x30);
b.SetUint8(-2, 0x40);
var s0 = b.GetHexaString(0);   // The result will be "10203040"
b.Insert(2, 1);
var s1 = b.GetHexaString(0);   // The result will be "1020003040"

Pm9.00.25: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

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