6.2. tsStringAlloc

Syntax

Pascal

function tsStringAlloc(Size: tsInt): pWideChar;

C/C++

WideChar * tsStringAlloc(tsInt Size);

Description

Allocates an new empty widestring.

Parameters

Size

The size of the resulting string buffer. But it is really the size? No. Because of some security reasons the real size will be increased by one. So it's not necessary to think of the ending zero word. So it's not possible to forget this endword.

Return Values

Return value is an null terminated widestring. All chars are filles with zero.

If any error occours the return value will be nil / NULL.

Error Codes

TS_NOT_INITIALIZED

The internal garbage collection needs to register the strings so the TextSuite library needs to be initialized. See also tsInit.

TS_OUT_OF_MEMORY

If the allocated string is to large.

TS_ERROR

There was an unknown error. Please inform me in which case this happens.