[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Allocate a copy of a shortstring on the heap.
Source position: objects.pp line 628
procedure SetStr( |
var p: PString; |
const s: String |
); |
SetStr makes a copy of the string S on the heap and returns the pointer to this copy in P. If P pointed to another string (i.e. was not Nil, the memory is released first. Contrary to NewStr, if the string is empty then a pointer to an empty string is returned.
The allocated memory is not based on the declared size of the string passed to NewStr, but is based on the actual length of the string.
If not enough memory is available, an 'out of memory' error will occur.
|
Dispose of a shortstring which was allocated on the heap. |
|
|
Allocate a copy of a shortstring on the heap. |
lazarus-ccr.sourceforge.net |