Function EN Version 5.00

@SetPosBuffer

System

Syntax

@SetPosBuffer(BUFFERHANDLE1;POSITION2;MODE3);

Description

Sets the position in the BINBUFFER with BUFFERHANDLE BUFFERHANDLE1 to the values specified in FN POSITION2 (in bytes), taking into account mode TEXT MODE3.

MODE3:
S=Calculated from the start of the BINBUFFER
C=Current position + POSITION2
E=End position – POSITION2

Example: @SetPosBuffer(BUFFERHANDLE1;POSITION2;MODE3)

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 BINBUFFER.
The position is reset to 0, and the first 12 bytes are read from this BINBUFFER 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.