Click or drag to resize

Logic2Bin Function

Convert a logical value to a string containing an 8-bit logical value.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.6
Syntax
 FUNCTION Logic2Bin(
	lValue AS LOGIC
) AS STRING
Request Example View Source

Parameters

lValue
Type: Boolean
The logical value to convert.

Return Value

Type: String
Remarks
Logic2Bin() is a conversion function that converts a logical data type into a 1-byte string.  Typical applications include saving data in their native format, data decryption, and transmitting logical data in their binary form.
Its inverse is Bin2Logic().
Examples
This example creates a new binary file, then writes a logical value in a binary forO:
X#
1LOCAL ptrHandle AS PTR
2ptrHandle := FCreate("MyFile", FC_NORMAL)
3FWrite3(ptrHandle, Logic2Bin(TRUE), 1)
4FClose(ptrHandle)
See Also