Bin2Logic Function | |
Convert a string containing an 8-bit logical into a logical value.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION Bin2Logic(
pszLogical AS PSZ
) AS LOGIC
public static bool Bin2Logic(
Psz pszLogical
)
Request Example
View SourceParameters
- pszLogical
- Type: Psz
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().
Remarks Tip |
---|
The PSZ type is included in the X# language and runtime for compatibility only.
In most cases the type can and should be replaced with normal strings.
If you need to interface with Win32 API functions that expect an ansi string, there is often also
an alternative with a unicode string. We recommend to use that alternative when possible.
|
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