Macro Language Reference > Macros > Debug > debug
  
debug
Description
The debug command is used extensively in the development of PTC ALD and its templates to debug scripts. It enables you to write information about a script to an error log: the serrlog.3at file in the PTC ALD system directory. As PTC ALD processes a step in a script, the debug command will output the information in its debug log.
Syntax
debug end:s?
debug
end
Debug a line in a script to the end of the line
Additional Information
In the following example, debug is used to debug a script, in conjunction with automac, a command that enables a script to be run automatically when an assigned expression changes:
automac 1,"v21812",0,"(debug e^1800 ^11810 ^21812^)",2
automac 2,"v01818",0,"(debug e^1800 ^11810 ^21812^)",2
Line 1: Defines the first automac command, which 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 PTC ALD system directory.
Line 2: defines the second automac command, which 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 the script (line number). This information will be automatically sent to the serrlog.3at error log in the PTC ALD system directory.
 
This macro is only used by PTC ALD and it is not recommended that you try to use it directly or for anything other than its intended purpose.