Page 1 of 1
Change of DebugLevel outside procs ...
Posted: Fri Sep 18, 2009 2:37 pm
by helpy
In the following code the change of the debug level does not have any effect on the Debug calls;
Code: Select all
Macro DebugError( __msg__ )
Debug "ERROR: " + __msg__
EndMacro
Macro DebugWarning( __msg__ )
Debug "WARNING: " + __msg__, 1
EndMacro
Macro DebugNote( __msg__ )
Debug "NOTE: " + __msg__, 2
EndMacro
Procedure SendDebugMessages()
Debug "-"
DebugError( "This is an error message ..." )
DebugWarning( "This is an warning message ..." )
DebugNote( "This is just a note ..." )
EndProcedure
DebugLevel 0
SendDebugMessages()
DebugLevel 1
SendDebugMessages()
DebugLevel 2
SendDebugMessages()
DebugLevel 3
SendDebugMessages()
Would be nice if this would be implemented
Re: Change of DebugLevel outside procs ...
Posted: Fri Sep 18, 2009 2:48 pm
by Kaeru Gaman
Syntax
DebugLevel <constant expression>
Description
Set the current debug level for the 'Debug' message.
Note: The debug level is set at compile time, which means than you have to put the DebugLevel command before any other Debug commands to be sure it affects them all.
Syntax
DebugLevel <numerischer Wert>
Beschreibung
Legt den aktuellen DebugLevel für die Debug Mitteilung fest.
Hinweis: Der DebugLevel wird zum Zeitpunkt des Kompilierens festgelegt. Dies bedeutet, dass Sie den DebugLevel Befehl vor jedem anderen Debug-Befehl einfügen müssen, um sicher zu gehen, dass dieser sich auf alle Debug-Befehle auswirkt.
=>
There is only ONE DebugLevel for the WHOLE Debugging session, no change of the Level at Runtime.
you can put ONE DebugLevel instruction to the top of your code, this level will be applied when you press F5 and last until the program ends.
Re: Change of DebugLevel outside procs ...
Posted: Fri Sep 18, 2009 3:23 pm
by helpy
Danke Kaeru! ... Thank you Kaeru
I did not consider this correlation!
But it is possible to change the DebugLevel during compile time:
Code: Select all
Macro DebugError( __msg__ )
Debug "ERROR: " + __msg__
EndMacro
Macro DebugWarning( __msg__ )
Debug "WARNING: " + __msg__, 1
EndMacro
Macro DebugNote( __msg__ )
Debug "NOTE: " + __msg__, 2
EndMacro
Macro SendDebugMessagesM()
Debug "-"
DebugError( "This is an error message ..." )
DebugWarning( "This is an warning message ..." )
DebugNote( "This is just a note ..." )
EndMacro
DebugLevel 0
SendDebugMessagesM()
DebugLevel 1
SendDebugMessagesM()
DebugLevel 2
SendDebugMessagesM()
DebugLevel 3
SendDebugMessagesM()
This was the reason for my first request!
Now I know that for each Debug command the DebugLevel is used, which is valid at this point of compilation.
OK! An adminstrator/moderator may move this topic somewhere else.
cu, helpy