Documentation component by John Kelly QDEBUG   

QDEBUG Component

QDEBUG  is a self-contained form that is handy for debugging loops, and code without interrupting program flow. The component is included in RAPIDQ2.INC. Some of the original code is from Pete Kleinschmidt and Michael Zito. Written by John Kelly. Windows 32 only. Cannot make arrays of this object and it must be declared at the GLOBAL level.

QDEBUG Properties



Read/Write Default
Form QFORM       You can reset the Debug form just like any other form:
                     Debug.Form.Width = 100
                     Debug.Form.Font = myQFont, etc.
R/W  
Visible LONG R/W True
Enabled  LONG       Determines if the form is 
                  0 (or False) = fixed/read-only 
                  1 (or True) = Debug window can be moved by user/closed etc.
R/W True

QDEBUG Methods

Method Type Description Params




Print SUBI (...) Print out standard variable types, and strings infinite
Bug  SUB (Str AS STRING)  keep compatible with previous release 1
PrintStr SUB (Str AS STRING) Print out a string or variable converted to string 1
Err$ FUNCTION () AS STRING
 
Uses the Windows GETLASTERROR API and formats it into a text message. CAREFUL,  if your program doesn't create an error, it will report the previous error. 0
ErrNum FUNCTION () AS DWORD  Returns the last Windows Error, if you want to see the code for Err$ 0

QDEBUG Events

Event Type Occurs when... Params





None  ...

QDEBUG Example


$TYPECHECK ON
$INCLUDE "RAPIDQ2.INC"
DECLARE SUB btnTestClick
DIM Debug AS QDEBUG         'Should declare as global
CREATE frmTest AS QFORM
Caption = "Debug Test Program"
Center
CREATE btnTest AS QBUTTON
Caption = "OK"
Top = 30
Left = 30
Height = 20
OnClick = btnTestClick
END CREATE
END CREATE

SUB btnTestClick
DIM I AS INTEGER
DIM J AS INTEGER
FOR J = 1 TO 3
FOR I = 1 TO 20
Debug.Print("Run ", I, " through Loop", J) 'send strings AND varaibles to debug object
' Debug.ErrNum
' Debug.Err$ 'default output to window
NEXT
NEXT
END SUB

frmTest.ShowModal
$ENDIF


QDEBUG Example #2
'create an error
$INCLUDE "RAPIDQ2.INC"
DIM Debug AS QDEBUG 'Should declare as global
SetLastError ERROR_BAD_USERNAME
Showmessage "debug error = " + Debug.Err$ + " Err#"+str$(Debug.ErrNum)

 
                       Contents  
Hosted by uCoz