Function EN Version 5.00

@CreateBuffer

System

Syntax

@CreateBuffer(FNSIZE1);
@CreateBuffer(FNSIZE1;FNUSEDSIZE2);
@CreateBuffer(FNSIZE1;FNUSEDSIZE2;FNSETPOS3);
@CreateBuffer(FNSIZE1;FNUSEDSIZE2;FNSETPOS3;TEXTSETPOSMODE4);

Description

With @CreateBuffer, a binary buffer of data type BINBUFFER is created.

Return:
A handle to the allocated binary buffer of data type BINBUFFER or @Error.

FN FNSIZE1:
Size of the binary buffer.

FN FNUSEDSIZE2:
Set the used size initially. (default = 0)

FN FNSETPOS3:
Set the position initially. (default = 0)

FN TEXTSETPOSMODE4:
Specify the mode for the initial position determination.
"S" = from the start. (default)
"C" = from the current position. (The current position is initially 0; therefore this behaves like "S" here.)
"E" = from the end.

Example: @CreateBuffer(FNSIZE1)

BinBuffer:=@CreateBuffer(100);
@WriteBuffer(BinBuffer;"Test Text \X0D\X0A");
@SetPosBuffer(BinBuffer;0;"S");
ReadBin:=@ReadBuffer(BinBuffer;"B";12);
@LogReport(ReadBin;11);
BinBuffer:=@DestroyBuffer(BinBuffer);

Creates a BINBUFFER with 100 bytes and writes the text "Test Text " followed by CR/LF into this BINBUFFERBINBUFFER as binary data (data type RT).
The data is then output to the APILOG, and the BINBUFFER is destroyed again.

Note : This text was machine-translated and may contain inaccuracies.