1. QLISTVIEW  OnColumnClick problem

QLISTVIEW
1. ColumnsCount INTEGER (Bug - always  -1)
OnColumnClick SUB (Column%) Column header was clicked
This sub is bugly!  Always return 0 in Column%  See example2 to solve this problem

 


2. RapidQ creates one more instance than asked
 
dim form as qform
form.center
dim edit(1) as qedit
for i = 0 to 2
edit(i).left = 10
edit(i).parent = form
edit(i).top = (40 * i)
edit(i).text = "Edit_" + str$(i)
next
form.showmodal


Question

So, when I say:
Dim edit(1) as qedit
I make an array of QEDITs with 2 elements:
Edit(0)
Edit(1)

Isn't it ? But why can I make Edit(2) too ?  
Note: if you write for i = 0 to 3
you'll get an access violation....
where's the trick ?!?!?
Trenchtownman <trenchto...@yahoo.it>


Answer
You are very right. I have tried you example with 3, 4, 5 and 6.
Each time, rapidQ creates one more instance than asked (ie it seems
that when you "dim edit(x)", rapidQ creates instances from 0 to x+1).
Very curious, indeed !?
Pascal Delcombel <pascalde....@yahoo.fr>


3. RAPIDQ don't like comments on line containing "\\" or "\", compiler reports
an error and there is none.

rem c:\werwer\\  'cause error
'   c:\werwer\\  'works fine


---------------------------------
a=5 rem fkfkl, - not working
a=5 ' fkfkl,   - working   
---------------------------------
Don't use REM !!


4. RAPIDQ don't support  NESTED TYPES

TYPE QField
     fName as String*30
     fType as String*30
     fData as String*30
END TYPE

TYPE QTable
     tName as String*30
     Field(20) as QField
END TYPE


Use instead, it's the same

TYPE QTable
     tName as String*30
     'Field(20) as QField
     fName as String*30
     fType as String*30
     fData as String*30

END TYPE

 


5.   UBOUND/LBOUND not works properly with array passed in function as parameter.

Always return UBOUND/LBOUND of first Dimmed array.  (Example 1a)
But if you use  SUB  instead Function it's all right!


Example 1a

'------- begin code ----------------------------- 

function ArrBug (D!() as single, a$ as string ) as single
'Sub ArrBug (D!() as single, a$ as string ) 

defint MaxE=0,MinE=0
print a$
MaxE = UBOUND(D!): print "in function MaxE=" ,MaxE
MinE = LBOUND(D!): print "in function MinE=" ,MinE
'END Sub   
END function '---------------------'  

defint MaxEl=0,MinEl=0

DefSng MyArray(1 To 5) = { 1, 2, 3, 4, 5}

MaxEl = UBOUND(MyArray): print "UBOUND(MyArray)=" ,MaxEl
MinEl = LBOUND(MyArray): print "LBOUND(MyArray)=" ,MinEl
print "---"

DefSng NewArray(4 To 6) = { 11, 12, 13, 14, 15, 12, 31, 41}

MaxEl = UBOUND(NewArray): print "UBOUND(NewArray)=" ,MaxEl
MinEl = LBOUND(NewArray): print "LBOUND(NewArray)=" ,MinEl
print "---"

DefSng LastArray!(0 to 3) ={10, -100, 20, 30}

MaxEl = UBOUND(LastArray!): print "UBOUND(LastArray!)=" ,MaxEl
MinEl = LBOUND(LastArray!): print "LBOUND(LastArray!)=" ,MinEl
print "---"

a= ArrBug (MyArray, "MyArray")
call ArrBug LastArray!(),"LastArray"  
call ArrBug (NewArray,"NewArray")
'----- end code -------------------  

6.  RAPIDQ  not testing  out of range array Index. 

DefSng MyArray(3)
MyArray(7000000)=2354
print "MyArray(7000000)=",MyArray(7000000)


7. Ubound\Lbound not working properly with array's names ended by %, ! ets.

DIM A%(-50 TO 100) AS INTEGER
L% = UBOUND(A%) '-- Returns 0


8. Take a breather. Here's something funny (well, almost).

Strange bug can occurs if you define event handler, but SUB doesn't exists.

'Did you know that you can prevent a form from closing when the X button
'is clicked if your form.caption were just 4-5 characters long?

'Strange but true:

DECLARE SUB Strange

CREATE Form AS QFORM
    Caption = "12345"
    OnClose = Strange
    ShowModal
END CREATE


9. When I use extended RichEdit component with popup menu, and try to add new RichEditWndProc, there is bug.
I can't use RichEdit.AddStrings method - garbage adds to richedit text.

' ---- Begin RQ CODE (Jacques Philippe) ---- 

$INCLUDE "RAPIDQ.INC"
CONST GWL_WNDPROC = (-4)

DECLARE FUNCTION SetWindowLongAPI LIB "user32" ALIAS "SetWindowLongA" _
(ByVal hWnd AS LONG, ByVal nIndex AS LONG, ByVal dwNewLong AS LONG) AS LONG
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
(lpPrevWndFunc As Long, hWnd As Long, uMsg As Long, wParam As Long, lParam As Long) As Long
Declare FUNCTION RichEditWndProc1 (hWnd AS LONG, uMsg AS LONG, wParam AS LONG, lParam AS LONG) AS LONG
' 
Declare Sub OnClickB
'***************************************** 
CREATE Form AS QFORM
	Caption = "Form1"
	Width = 640
	Height = 480
	Center
	CREATE SrcEdit AS QRICHEDIT
		Align= alClient
	END CREATE
	CREATE Panel1 AS QPANEL
		Align=Alleft
		width=100
		Caption = "Panel1"
		CREATE Button1 AS QBUTTON
			Caption = "Button1"
			OnClick=OnClickB
		END CREATE
	END CREATE
END CREATE
' 
DefInt OldRichEditWndProc
' Comment uncomment the following line  
OldRichEditWndProc = SetWindowLongAPI(SrcEdit.Handle, GWL_WNDPROC,CodePtr(RichEditWndProc1))

Form.ShowModal

FUNCTION RichEditWndProc1 (hWnd AS LONG, uMsg AS LONG, wParam AS LONG, lParam AS LONG) AS LONG
Result = CallWindowProc(OldRichEditWndProc, hWnd, uMsg, wParam, lParam)
end function

Sub OnClickB
SrcEdit.Clear
SrcEdit.text = "$INCLUDE " + "RAPIDQ.INC"
SrcEdit.AddStrings "-- Declarations" 
' Text 'CallWindowProcA' is outputed here ! With " -- Declaration" it's OK :) 
End Sub
' ---- END RQ CODE ---- 

Recommendations

1. If you replace Addstring by sending a EM_REPLACESEL message to the RichEdit ... it works perfectly

' ---- DECLARE ----
Declare Function SendMessageX Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
                                                            ByVal wParam As Long, lParam As Long) As Long
Const EM_REPLACESEL = &HC2
(Jacques Philippe)

2. I use  clipboard.text="blah" and PasteFromClipboard instead AddStrings.
(Andrew Shelkovenko)

10. QStringGrid has a bug with color

If your screen has TrueColore mode (32 bit) - there are no errors when you change QStringGrid color.
If your screen has HiColore mode (24,16 bit or less) - there are errors when  QStringGrid color is truecolor  

11. Memory leaks when Sub \ Function calls under Windows 98

~
1791999 - number of calling sub before crashing.
error message  is "Out of memory while expanding memory stream"
There are fixed lib's (from Dr. Electrons) do fix the memory leak in the original lib's. 
But there are problems with using its in some cases
.


12. QDirTree InitialDir property  can cause delay (2-4) sec when sets.

Not bug yet


13. Using QStringList for string manipulation a lot faster then using QRichEdit.

Not bug yet


'*****************************************
Sub DelEmptyLinesOnClick
dim FakeList as QStringList
dim FakeListOut as QStringList
'call  AddClrString ("7257:FakeList.ItemCount-1="+str$(FakeList.ItemCount-1), clred, LogEdit)
FakeList.Text=SrcEdit.Text
oldi=0
Gauge1.Forecolor=clDg:Gauge1.visible=1: Gauge1.position=0
for i=0 to FakeList.ItemCount-1
 if trim$(FakeList.Item(i)-ht)<>"" then
  FakeListOut.AddItems FakeList.Item(i)
 end if
 if i>oldi+150 then
  oldi=i
  Gauge1.position=i/(SrcEdit.LineCount+1)*100
 end if
next
Gauge1.visible=0:Gauge1.Forecolor=clR:
SrcEdit.Text=FakeListOut.Text

End Sub


14. RapidQ not supports  MULTIPLE CALLBACKS.

Thanks to JohnK's work with my CallBack Forwarder - which I thought was a useless dead thing -, it's now possible and rather easy to have multiple
callback function in RapidQ.

See     http://erdemal.webhop.org/RapidQ/ManyRqCallBack.zip          (5KBytes)

Jacques


15. Be carefully with REDIM

Strange bug can occurs if you Redim Array without AS


16. Be carefully with Arrays of UDT.

16.1 

TYPE TTest
S AS STRING*8
N AS INTEGER
na(5) as integer
END TYPE

DIM Test AS TTest
Dim Testa (10) as TTest

CREATE Form AS QFORM
	Caption = "Test UDT": Center
	CREATE RichEdit1 AS QRICHEDIT
		BorderStyle = 0: 
	END CREATE
END CREATE

Test.s="qwerty"
Test.n=12345
for j%=1 to 5 : Test.na(j%)=j%: next

RichEdit1.AddStrings "Test.na(1)="+ str$(Test.na(1))

Testa(2)=Test '
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' 

Form.ShowModal

16.2 Testa(2)=Test ' be carefully!!!
setting equal to one UDT to another may not works!!

17. QUICKSORT not see array passed as parameter.
It's require that array is declared in Sub