Converts from Win32 binary types into OI numbers
The equivalent OI value represented by the Win32 datatype.
|Value||The Win32 datatype value.|
|Type||The Win32 type|
Win32 types (INT, FLOAT, etc.) are stored in binary form and are not usable as-is within standard BASIC+ methods. This method makes it easy to convert them into OI variables for use in BASIC+. Simply pass the Win32 value and its type, and you get a number returned. The following types are available for use in the Type parameter:
|16-Bit Signed Integer||"WORD", "SHORT", or "INT16"|
|16-Bit Unsigned Integer||"UWORD", "USHORT", or "UINT16"|
|32-Bit Signed Integer||"LONG", "INT", or "INT32"|
|32-Bit Unsigned Integer||"ULONG", "UINT", "DWORD", or "UINT32"|
|64-Bit Signed Integer||"LONGLONG", or "INT64"|
|64-Bit Unsigned Integer||"ULONGLONG", or "UINT64"|
The best example is when receiving data from a socket, which often pass these kinds of data types. In this example, the length of an incoming string is passed first as a 32-bit integer, so we have to convert into an OI value before passing it into SRP_TcpClient again to pull the string.