PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Extracts an integer found in a binary buffer at a given position.
Example
// Extract the integer found at byte 52 of test.raw file

// Load the buffer corresponding to the test.raw file
bMyBuffer is Buffer = fLoadBuffer("C:\Test\test.raw")
// Check that it loaded properly
IF bMyBuffer = "" THEN
Error("Error while reading the buffer")
RETURN
END
// Extract the integer found at byte 52
nMyInteger is int = BufferToInteger(bMyBuffer, 52)
Syntax
<Result> = BufferToInteger(<Buffer to Use> [, <Position> [, <Number of Bytes to Read>]])
<Result>: Integer
Integer extracted from the buffer.
<Buffer to Use>: Buffer
Name of buffer variable loaded in memory containing the sought integer. This parameter can also correspond to an Ansi or Unicode string.
<Position>: Optional integer
Position at which the integer is sought. The first position of the buffer corresponds to 0.
By default, <Position> is set to 0.
<Number of Bytes to Read>: Optional integer
Number of bytes on which the sought integer is coded. The value of this parameter can be set to 1, 2, 4 or 8.
By default, <Number of Bytes to Read> is set to 4.
Remarks
  • By default, the integer is read at the beginning of the buffer as an unsigned 4-byte integer (32 bits).
  • The bytes are read in Little-Endian mode (the low byte is read first).
Component : wd240std.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment