Click or drag to resize

Bin2DW Function

X#
Convert a string containing a 32-bit unsigned integer to a double word.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION Bin2DW(
	cUnsignedInt AS STRING
) AS DWORD
Request Example View Source

Parameters

cUnsignedInt
Type: String
A 32-bit unsigned integer represented as a string — least significant byte first. Only the first 4 bytes are used by the function; all others are ignored.

Return Value

Type: DWord
Remarks
Bin2DW() is a conversion function that converts the first 4 bytes of a string to a double word. Typical applications include reading foreign file types in their native format then saving, reading, decrypting, and transmitting numeric data in their compressed binary form instead of in strings.
Its inverse is DW2Bin().
Examples
This example is passed 4 ASCII characters and returns a number that is 10 digits long:
X#
1? Bin2DW("abcd")        // 1684234849
See Also