ArborX


debug

Longname: debug   Open the Documentation Legend
Released: not available 
Created: not available 
See also: trace getvar automac

Summary
The debug command is used extensively in the development of 3B2. It is possible to use debug to debug scripts. The debug macro enables you to write information about a script to an error log. The error log is the serrlog.3at in the 3B2 system directory. Every time 3B2 processes a step in a script, the debug command will output the information in its debug log. To view the information in the serrlog.3at file, open the file in a text editor such as Notepad.
Example (n/a)
No example is available for this feature.

Syntax (1.00)
debug Ø
debug  end:s?
end:s Debugs a line in a script to the end of the line.

In the following example, debug is used in conjunction with automac. The automac command enables a script to be run automatically when the assigned expression changes. The following example could be used to debug a script:

 automac 1,"v21812",0,"(debug e^1800 ^11810 ^21812^)",2 3
 automac 2,"v01818",0,"(debug e^1800 ^11810 ^21812^)",2 5
1
Defines the first automac. The automac will be run each time a line of the script line is run. This is achieved by using the getvar 21812 to get the current position in a script. When errors in the script are located the debug macro will return the current script nesting level (getvar 1800), the current script name (getvar 11810) and the current position in script (line number). This information will be automatically sent to the serrlog.3at error log in the 3B2 system directory.
2
Defines the second automac. The automac will be run each time the internal id of a script is different (i.e a different script that has been triggered by a previous script). This is achieved by using the getvar 1818 to return the internal id of the current script. When errors in the script are located the debug macro will return the current script nesting level (getvar 1800), the current script name (getvar 11810) and the current position in script (line number). This information will be automatically sent to the serrlog.3at error log in the 3B2 system directory.

Every time an error is located, reload the content of serrlog.3at in your text editor. You will then be able to see which script line was executed last and caused the script to stop working.

This macro is only used by 3B2 and it is not recomended that you try to use this directly or for anything other than it's initial purpose.

Document created on 2002-Nov-19 (revision 1)