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.19
Syntax FUNCTION Logic2Bin(
lValue AS LOGIC
) AS STRING
public static string Logic2Bin(
bool lValue
)
Request Example
View SourceParameters
- lValue
- Type: Logic
The logical value to convert.
Return Value
Type:
StringRemarks
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:
1LOCAL ptrHandle AS PTR
2ptrHandle := FCreate("MyFile", FC_NORMAL)
3FWrite3(ptrHandle, Logic2Bin(TRUE), 1)
4FClose(ptrHandle)
See Also