known bugs as of January, 2009
Andrew's Bug List and to David Burkley's
- ARRAYS There is no checking for limits on data arrays. You can
"read" an array value outside that used in DIM, giving unpredictable results.
- UBOUND/LBOUND do not work properly with arrays passed to a FUNCTION
as parameter (returns the UBOUND/LBOUND of first DIMensioned array, may
work ok in a SUB. Also UBOUND/LBOUND does not work properly with
array's names ended by
%, ! etc. Just keep track of your array
bounds in separate variables.
DIM A%(-50 TO 100) AS INTEGER
UBOUND(A%) '-- Returns 0
- BYTE, SHORT, WORD, SINGLE, and DOUBLE must be stored in a 32-bit long
if passing ByVal to a DLL.
When passing ByVal, put BYTE,
SHORT, and WORD variables a 32-bit variable such as INTEGER, DWORD, or LONG.
If your DLL needs less than 2 SINGLE or more than 2 DOUBLE variables, these
will not be passed correctly! The safest way to pass these variables
ByRef if possible. If you must pass them ByVal then you should
just state them as INTEGERS or LONG, in the DECLARE statement.
'here is the actual API
SUB gluPerspective(fovy as Double, aspect as Double, zNear as
Double, zFar as Double)
'here is how to implement
DECLARE SUB gluPerspective_API LIB "glu32.dll" ALIAS
(f1 as long, f2as long, a1 as long, a2 as
long, z1 as long, z2 as long, z3 as long, z4 as long)
d: DEFINT i(7)
d = fovy: MemCpy (VarPtr(i(0)),
d = aspect: MemCpy (VarPtr(i(2)), VarPtr(d),
d = zNear: MemCpy (VarPtr(i(4)), VarPtr(d),
d = zFar: MemCpy (VarPtr(i(6)), VarPtr(d),
gluPerspective_API(i(0), i(1), i(2), i(3), i(4), i(5),
'here is another example of
Declare Sub keybd_event Lib "user32" Alias "keybd_event"
(bVk As BYTE, bScan As Long, dwFlags As Long, dwExtraInfo As
have to do is change BYTE to LONG, and it will work fine
Declare Sub keybd_event Lib "user32" Alias
(bVk As Long, bScan As Long, dwFlags As Long, dwExtraInfo
- If you make a RapidQ component array, one more instance is
dim form as
dim edit(1) as
for i = 0 to
edit(i).top = (40 *
edit(i).text = "Edit_"
- VARPTR and QUICKSORT do not work for arrays passed to a
(MyArray () AS INTEGER)
addr = VARPTR(MyArray(0)) ' doesn't recognize MyArray !
-- Be sure to pass the address of the array if you
want to use MEMCPY or QUICKSORT, etc.
- Local variables in SUB/FUNCTION use shared memory. Always initalize or set local variables in a SUB/FUNCTION, never assume a variable is initialized to zero. If you use STATIC this will not happen.
Dim I As Long
ShowMessage("I = " + Str$(I))
Dim NotI As Long
Dim J As
Long 'not shared because it is 2nd
ShowMessage("NotI = " + Str$(NotI))
ShowMessage("J = " + Str$(J))
For x = 1 to
- Use the Fixed Libraries if you use EXIT SUB and
EXIT FUNCTION, otherwise it will cause a memory leak.
This is caused by a
minor problem in the rapidQ.LIB files. Replace the .LIB files with the
"Snakedile Fixed libraries version 1.02 ( dated October, 2005 or later)
If you cannot use the new libraries, use GOTO to exit the SUB/FUNCTION like
FUNCTION Foo() AS
IF i > Max THEN GOTO
' do calculations
- If you have an array of QIMAGE then the OnMouseMove and OnMouseDown events
- The $MACRO command is unstable and should be avoided completely
unless the argument is very simple.. $DEFINE should be used for simple
positive number replacement only. For instance,
negative numbers in a $DEFINE statement will not compile
$DEFINE MyConst -1
in this case MyConst will be
equal to 0. This is a bug in the RapidQ compiler. Use CONST instead
- Only one CODEPTR for each function with the same number of
arguments. RapidQ2.inc demonstrates how to fix this problem.
i.e., you can use CODEPTR( FuncA) and CODEPTR(FuncB) only if
FuncA and FuncB have different number of parameters, and so on. If both
functions have the same number of parameters the address from first CODEPTR is
- The RIGHT$ function doesn't work properly with >32k
strings. Replace the .LIB files with the "Snakedile Fixed libraries
version 1.06 (dated November, 2006 or later)
ColumnsCount returns the wrong number on Read
QLISTVIEW - OnColumnClick (SUB (Column%)) - Always returns 0 in Column%
Replace the .LIB files with the "Snakedile
Fixed libraries version 1.07 (dated December, 2006) or later. If you cannot
get the new libs try QListViewEx instead (in the
- QFILESTREAM.ReadStr(n) adds a
space character to the end of the string read, which can make string
comparisons to fail. Also QFILESTREAM.LineCount counts LineFeeds. It loads file
in 30 KB at a time but does not to check the first byte of each block. This
means it can miss some lines.
- Many RapidQ Objects are FUNCTIONS rather than SUBs. For example,
QFileStream.Open is not a SUB as stated in the RQ HTML Documentation, but a
FUNCTION that returns ZERO when the file has an Open Failure.
- The original QCOMPORT was too buggy and removed from rapidq5.lib by
the author. Use the QCOMPORT component in RAPIDQ2.INC. It uses Win32API calls
so Windows only. If you use the new QCOMPORT the name of the object
cannot have the word "Comport" in it:
DIM myComport AS QCOMPORT
'compiler gives an error
DIM myCmprt AS QCOMPORT '
- Logical NOT operation is same as bitwise NOT. For RapidQ you should
compare a boolean expression for (IF xx = False OR yy = True) etc.
- Many QObjects also have
a SENDER parameter that is not documented.
- QLISTBOX.OnEnter doesn't work, use the
Form's OnKeyUp event to call a routine that traps the Enter key with the
Form's KeyPreview property set to 1 or True.
- QTABCONTROL.DelTabs requires the Fixed version 1.06 RC.EXE ( dated November, 2006 or later).
- Custom components created using CreateWindows API function can generate
runtime error 216 when form closing.
To prevent this, use
Application.Terminate in the Form.OnClose event handler.
- Use QRichEdit to get around the 64k limit in QEDIT (this problem exists
in earlier versions of Windows only):
'Place SendMessage after you create the richedit
'and before your show your main form.
CREATE form AS QFORM
CREATE richedit AS QRICHEDIT
SendMessage RichEdit.Handle, &HC5, 0, 1048576
- In "For i=n0 To n1...Next" statement, sometimes the variable i will always
equal to n0 throughout the whole loop though the cycle number is
- CONVBASE$() only accepts upper-case hex string and takes an
argument less than "FFFFFFFF" Replace the .LIB files with the "Snakedile
Fixed libraries version 1.06 ( dated November, 2006 or later).
- QCheckBox cannot be passed as an argument even declared
- BYTE cannot be returned correctly from a FUNCTION. An INTEGER
should be used instead.
- Direct3D: requires the D3DRM.DLL from
the Windows XP distribution to work under Windows VISTA and later.
- The "Cannot focus a disabled or invisible window" problem. See Chapter 1. Simply put the older richedit dll (dated
3/2003) into the rapidQ directory.
- There is poor error checking with EXIT statements. Be sure to use the correct EXIT statement:
Dim j As Integer
For j=1 To 2
' test=1 '
When 2 or more, only one loop i.
And in both cases,
when Exit Function/Sub is replaced by Exit For everything is OK ! Always
use EXIT FOR inside a For-next loop.
- If you use QListview.Clear, QListBox.Clear, QComboBox.Clear,
and find that it's really very Slow, do this :
Object.Visible = True
- If you don't have a sub for your onClose event (but declare
it) then there is no way to close the form.
DECLARE SUB Strange
CREATE Form AS QFORM
Caption = "12345"
OnClose = Strange
- Avoid REM for comments, especially with comments containing "\\" or
rem c:\werwer\\ 'causes
a=5 rem fkfkl :not
- QPOPUPMENU does not close when it loses focus. Your program will
have to close it by deleting all QMenuItems with QPOPUPMENU.DelItems.
- REDIM has a memory leak and does not clean up after each time it is
called. Be carefully with REDIM, strange bugs can occur if you Redim
Array without REDIM AS. RapidQ will let you REDIM arrays of
Qobjects/QForms, etc. but it actually does not work -- memory is not
deallocated or added components are not really added.
- The FORMAT$ statement has a large memory leak and may crash your program if called many times. Use the STRF$ function instead if needed.
- Nested UDTs are not supported. You must recode them
This will not work:
fData as String*30
Field(20) as QField 'error
This will work instead:
fData as String*30
- TYPE ... END TYPE, appears to allocate at least 32k memory for each
DIM xx AS TYPE:
create form as qform
caption = "Memory
BYTE 'Number of warps \/\/\/
warp2 AS WORD
warp3 AS WORD
warp4 AS WORD
warp6 AS WORD
DIM SecInfo(1000) AS SecInfoWarp
In two trials i got 32Mb, and 36Mb
for the second... Now i know that includes what ever DLL's the rapidq uses,
which is approx 9Mb (or maybe4.??Mb???) of those values... But that still
means that for an array of 1000 of my UDT equals approx. 23 - 27 Mb's... The UDT
should be like about 13 bytes, so
1000 times that should only equal 13,000 bytes!!! Im running Win98SE with
96Mb RAM, and a 330Mb swap file, and while i could compile that routine
at10,000, it caused such a drag on my system that Norton System Info wouldn't
run! Means that pretty much all availible memory PLUS swap file was used!!! That
means that on my system it must have used somewhere between 350Mb and 400Mb for
my UDT array of only 10,000!!! So what is going on here?!?!?!?
removed the warp AS BYTE/WORD and replaced them with a single "warps AS
STRING*13", and it still tells me that it is useing 36Mb!!!
If i removed the
UDT, and dimension the array like so...
DIM SecInfo(1000) AS WORD
then the program only use 4.7Mb(total including DLL's)!!! So it must be a bug
Be carefully with Arrays of UDT.
S AS STRING*8
N AS INTEGER
na(5) as integer
DIM Test AS TTest
Dim Testa (10) as TTest
CREATE Form AS QFORM
Caption = "Test UDT": Center
CREATE RichEdit1 AS QRICHEDIT
BorderStyle = 0:
for j%=1 to 5 : Test.na(j%)=j%: next
RichEdit1.AddStrings "Test.na(1)="+ str$(Test.na(1))
RichEdit1.AddStrings Testa(2).s+" "+str$(Testa(2).n)+" "+str$(Testa(2).na(1)) '------- 1'
Testa(2).na(1)=Test.na(1) ' ----- It doesn't work ! Why??
RichEdit1.AddStrings Testa(2).s+" "+str$(Testa(2).n)+" "+str$(Testa(2).na(1)) '---------2'
d=Test.na(1):Testa(2).na(1)=d '----- Wow! It works
RichEdit1.AddStrings Testa(2).s+" "+str$(Testa(2).n)+" "+str$(Testa(2).na(1)) '----------3'
Testa(2).na(1)=1'Test.na(1) '-------- It's simply ;-)
RichEdit1.AddStrings Testa(2).s+" "+str$(Testa(2).n)+" "+str$(Testa(2).na(1)) '----------4'
Testa(2)=Test ' be careful setting equal to one UDT to another may not work!!