Type ID Size Range
--------- ---- ---- -------------
Byte ? 1 0..255
Word ?? 2 0..65535
Dword ??? 4 Only Linux version for now...
Short % 2 -32768..32767
Integer & 4 -2147483648..2147483647
Long & 4 -2147483648..2147483647
Single ! 4 1.5 x 1045..3.4 x 1038
Double # 8 5.0 x 10324..1.7 x 10308
Rules to remember when porting code
written for application
programming interfaces (API)
C
data type
Visual Basic
RapidQ type
ATOM ByVal Var As Integer INTEGER
BOOL ByVal Var As Long LONG
BYTE ByVal Var As Byte BYTE
CHAR ByVal Var As Byte BYTE
COLORREF ByVal Var As Long LONG
DWORD ByVal Var As Long LONG, or DWORD
HWND ByVal Var As Long LONG
HDC ByVal Var As Long LONG
HMENU,etc.
(Windows
handles) ByVal Var As Long LONG
HDC ByVal Var As Long LONG
INT,
UINT ByVal Var As Long LONG, INTEGER
LONG ByVal Var As Long LONG
LPARAM ByVal Var As Long LONG
LPDWORD ByRef Var As Long LONG
LPINT,
LPUINT ByRef Var As Long LONG
LPRECT ByRef Var As type AS QRECT (Pointer to UDT)
LPSTR, LPCSTR ByVal Var As String STRING (converted to pointer)
**
RapidQ passes STRING type variable as a pointer (i.e., by reference). When
calling
a DLL with a STRING variable type you must have the correct DECLARE statement:
MyAPIFunc(lpstr AS STRING) :e.g., MyAPIFunc(A$)
OR
MyAPIFunc(lpstr AS LONG) :e.g., MyAPIFunc(VARPTR(A$))
you cannot pass a string as an array of chars
LPVOID ByRef Var As Any LONG (Pointer, not STRING)
LPWORD ByRef Var As Integer INTEGER
LRESULT ByVal Var As Long LONG
NULL ByVal Var As Long ByVal 0&
SHORT ByVal Var As Integer SHORT
VOID SUB(vars) SUB(vars) no return var
WORD ByVal Var As Integer
WORD
PDWORD ByRef var AS LONG LONG (pointer to a dword)
WPARAM ByVal Var As Long LONG
Many other types exist- the general rule is that if C declares the variable with an “L” or “LP” as the fist characters then it is a pointer of type LONG. RapidQ can accept but does not strictly support the unsigned data types such as DWORD, UINT8, UINT16, UINT32, UINT64,etc.