SetSegment (FUN)ΒΆ

FUNCTION SetSegment : IString

Initializes the passed IString instance and uses the specified memory area for this purpose

Example for a 80 byte IString instance:

abyMemory : ARRAY[0..79) OF BYTE;
   myString : _UTF8String;
itfString : IString := SetSegment(myString, ADR(abyMemory), SIZEOF(abyMemory), 0);
InOut:

Scope

Name

Type

Comment

Return

SetSegment

IString

Input

itfString

IString

String instance of an _UTF8String|

pbyMemory

POINTER TO BYTE

Pointer to the first byte of the memory.
This address should aligned to a __XWORD boundary!

udiSize

UDINT

Size of the whole allocated memory

udiLength

UDINT

Length of the segment in bytes

Output

eErrorID

ERROR