Returns the size of a string's currently allocated memory buffer.
Kernel.bdh
StrSize( in sString : string ): number;
the amount of memory the string has currently allocated
Parameter | Description |
---|---|
sString | String whose memory size is to be retrieved. |
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;
Allocated memory: 254 Bytes Allocated memory: 1024 Bytes Allocated memory: 100 Bytes