nNewSize | (Long) New data block size specified absolutely or relatively to the current size see the nMode parameter. |
---|---|
nMode | [optional] (Long) Specifies the behavior when the size of existing data block is changed.
0 (default) - New size of the data block entered absolutely.
The content of existing data block will not be preserved. New data block will be created and zeroed. The value of the AutoOffset property is set to 0. 1 - New size of the data block entered absolutely.
The content of existing data block will be preserved. The existing data block will either be enlarged or reduced in size. Only the modified area will be zeroed. The value of the AutoOffset property is kept if it is relevant in the new size, otherwise is set to 0. 2 - New size of the data block entered relatively.
The content of existing data block will be preserved. The existing data block will either be enlarged or reduced in size. Only the modified area will be zeroed. The value of the AutoOffset property is kept if it is relevant in the new size, otherwise is set to 0. |
var oBuf = Pm.CreatePmBuffer();
var s1 = "40302010605070";
oBuf.SetHexaString(-2, s1);
var nSize = oBuf.GetSize();
// nSize = 7
oBuf.SetSize(-2, 2);
var val = oBuf.GetHexaString();
// val = 4030201060