Bin2Logic Function | |
Convert a string containing an 8-bit logical into a logical value.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION Bin2Logic(
pszLogical AS STRING
) AS LOGIC
public static bool Bin2Logic(
string pszLogical
)
Request Example
View SourceParameters
- pszLogical
- Type: String
An 8-bit logical represented as a string.
Return Value
Type:
LogicRemarks
Bin2Logic() is a conversion function that converts the first byte of a string to a logical. Typical applications include saving data in their native format, data decryption, and transmitting logical data in their binary form.
Its inverse is Logic2Bin().
Examples
This example opens a file using file functions, reads the first byte as a binary logical, then converts it into a logical value:
1ptrHandle := FOpen("sales.txt", FO_READ)
2cByte := Space(1)
3FRead(ptrHandle, @cByte, 1)
4? Bin2Logic(cByte)))
5FClose(ptrHandle)
See Also