Difference between revisions of "SET DEBUG"

From Recital Documentation Wiki
Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Error Handling and Debugging
 
 
 
 
==Purpose==
 
==Purpose==
Toggle sending of echoed commands to printer
+
Enable or disable the logging of [[DEBUG()]] messages
  
  
Line 12: Line 8:
  
 
==See Also==
 
==See Also==
[[SET ALTERNATE]], [[SET ECHO]], [[SET PRINT]], [[SET PRINTER]], [[SET TALK]]
+
[[ASSERT]], [[DB_DEBUGDIR]], [[DEBUG]], [[DEBUG()]], [[SET ASSERTS]]
  
  
 
==Description==
 
==Description==
If SET DEBUG is ON and SET ECHO is ON, then each command that is read from a program file is displayed on the printerThis command is primarily used in program debugging.  By default, DEBUG is OFF.
+
If SET DEBUG is ON, debugging information messages specified by the [[DEBUG()]] function are written to a text file in the current [[DB_DEBUGDIR]] directoryThe text file is named ''debug'' + process ID + ''.txt''.  A copy of the latest debug file can also be found in the file ''debug.txt''.  By default, DEBUG is OFF.
  
  
Line 22: Line 18:
 
<code lang="recital">
 
<code lang="recital">
 
set debug on
 
set debug on
set echo on
+
 
do yourproc</code>
+
// app1.prg
 +
debug("program started by " + user())
 +
//...
 +
debug("program end")
 +
</code>
  
  
 
==Products==
 
==Products==
Recital Terminal Developer
+
Recital, Recital Server
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]

Latest revision as of 11:03, 27 July 2010

Purpose

Enable or disable the logging of DEBUG() messages


Syntax

SET DEBUG ON | OFF | (<expL>)


See Also

ASSERT, DB_DEBUGDIR, DEBUG, DEBUG(), SET ASSERTS


Description

If SET DEBUG is ON, debugging information messages specified by the DEBUG() function are written to a text file in the current DB_DEBUGDIR directory. The text file is named debug + process ID + .txt. A copy of the latest debug file can also be found in the file debug.txt. By default, DEBUG is OFF.


Example

set debug on
 
// app1.prg
debug("program started by " + user())
//...
debug("program end")


Products

Recital, Recital Server