@HexDumpToBin
Syntax
@HexDumpToBin(VAR1);
@HexDumpToBin(VAR1;TEXTRETTYPE2);
Description
@HexDumpToBin converts the hex stream dump in TEXT/BINBUFFER VAR1 into a binary buffer.
Whitespace is ignored.
Using TEXT TEXTRETTYPE2 it can be specified whether the returned binary data is returned as RT or as BINBUFFER.
TEXT TEXTRETTYPE2:
RT = RICHTEXT
B = BINBUFFER (default)
Example: @HexDumpToBin(VAR1)
Var:="123456789012345678";
HexDumpBinBuffer:=@GetHexDump(Var;12);
BinaryBinBuffer:=@HexDumpToBin(HexDumpBinBuffer);
HexDumpBinBuffer:=@DestroyBuffer(HexDumpBinBuffer);
@GetBufferInfo(BinaryBinBuffer;BinaryBinBufferUsedSize);
@SetPosBuffer(BinaryBinBuffer;0;"S");
OriginalText:=@ReadBuffer(BinaryBinBuffer;"A";BinaryBinBufferUsedSize);
BinaryBinBuffer:=@DestroyBuffer(BinaryBinBuffer);
@LogReport(OriginalText;3);
The TEXT variable Var is output as a stream dump without spaces into a BINBUFFER HexDumpBinBuffer.
The stream hex dump is then converted back into binary data and assigned to the BINBUFFER BinaryBinBuffer.
The number of bytes these binary data comprise is determined, and then the position in the BINBUFFER BinaryBinBuffer is set to 0.
The binary data are read and assigned as TEXT to the variable OriginalText, and this TEXT is output to the APILOG.
The BINBUFFER HexDumpBinBuffer and BinaryBinBuffer are each released as soon as they are no longer needed.
Example output in the APILOG:
123456789012345678
Example: @HexDumpToBin(VAR1;TEXTRETTYPE2)
Var:="123456789012345678";
RetDataType:="RT";
HexDumpBinBuffer:=@GetHexDump(Var;12);
BinaryRT:=@HexDumpToBin(HexDumpBinBuffer;RetDataType);
HexDumpBinBuffer:=@DestroyBuffer(HexDumpBinBuffer);
@LogReport(BinaryRT;3);
The TEXT variable Var is output as a stream dump without spaces into a BINBUFFER HexDumpBinBuffer.
The stream hex dump is then converted back into binary data and assigned as RT to the variable BinaryRT.
The BINBUFFER HexDumpBinBuffer is released, and the content of the RT variable BinaryRT is output in the APILOG.
Example output in the APILOG:
L:0012 L:18
0000 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 123456789012345678
Note : This text was machine-translated and may contain inaccuracies.
