Sign in Join
FPDoc Onlineexperiment

NewStr function

In unit sysutils

Allocate a new ansistring on the heap.

Declaration

pascal
function NewStr(const S: string): PString; overload

Description

NewStr assigns a new dynamic string on the heap, copies S into it, and returns a pointer to the newly assigned string.

This function is obsolete, and shouldn't be used any more. The AnsiString mechanism also allocates ansistrings on the heap, and should be preferred over this mechanism.

For an example, see AssignStr.

Errors

If not enough memory is present, an EOutOfMemory exception will be raised.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.