[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
SQR and Debug
Ahhhh, the joy of debugging. Actually, one of my favorite things to do to
an SQR.
SQR has a command (#DEBUG) which will cause the current command to be
processed during a debugging session. Also, you can nest many commands
within an #IFDEF and #ENDIF. Typically, I use the #DEBUG upon the
enter/exit of a procedure. Also, will use the nest to list several
variables and their current state. All commands within the #DEBUG/Nest
execute as always, however they only execute when you add the -DEBUG flag to
your SQR flags. Finally, you can create different levels of debug by
appending letters to your #DEBUG/Nest statements, though I find this
confusing/difficult to maintain. You can reference the SQR help file for an
exact example of using multiple layers of debug.
The following are some examples:
!***************************************************************************
***
Begin-Procedure Calculate-Duration
#ifdef debug
show 'Enter Calculate-Duration'
show ' Began >' $Began '<'
show ' Ended >' $Ended '<'
show ' Date_Began >' $Date_Began '<'
show ' Time_Began >' $Time_Began '<'
show ' Date_Ended >' $Date_Ended '<'
show ' Time_Ended >' $Time_Ended '<'
#endif
!***************************************************************************
***
... commands and stuff ...
#ifdef debug
show 'Exit Calculate-Duration'
show ' Duration >' $Duration '<'
show ' Days >' #Days '<'
show ' Hours >' #Hours '< Process >' #Process_Hours '<'
show ' Mins >' #Mins '< Process >' #Process_Mins '<'
show ' Secs >' #Secs '< Process >' #Process_Secs '<'
#endif
End-Procedure
!***************************************************************************
***
Begin-Procedure Populate-Array
#debug show 'enter Populate-Array'
!***************************************************************************
***
... commands and stuff ...
#debug show 'exit Populate-Array'
End-Procedure
David Anderson
Compuware Professional Services
Oakwood Health Services - Muirhead