StrResize Function

Action

Resizes a string's memory buffer. The new size of the memory buffer is specified with a minimum and maximum value in order for the string to decide whether it must really resize its memory buffer.

Include file

Kernel.bdh

Syntax

StrResize ( in sString  : string,
            in nMinSize : number,
            in nMaxSize : number optional );
Parameter Description
sString String whose memory size is to be resized.
nMinSize Minimum value which the string's memory buffer is resized to.
nMaxSize Maximum value which the string's memory buffer is resized to (optional and default is unlimited).

Example

dcltrans
  transaction TMain
  var
    sString : string;
  begin
    Print("Allocated memory: " + string(StrSize(sString)) + " Bytes");

    StrResize(sString, 1024);
    Print("Allocated memory: " + string(StrSize(sString)) + " Bytes");
    StrResize(sString, 10, 100);
    Print("Allocated memory: " + string(StrSize(sString)) + " Bytes");
  end
TMain;

Output

Allocated memory: 254 Bytes
Allocated memory: 1024 Bytes
Allocated memory: 100 Bytes