Setup up a debug session using a specific reporting type
#include <Debug.au3>
_DebugSetup ( [$sTitle = Default [, $bBugReportInfos = False [, $vReportType = 1 [, $vLogFile = "" [, $bTimeStamp = False]]]]] )
If a specific reporting function is registered then on AutoIt exit it is called without parameters.
You can only start one debug session at a time in the running script.
You can debug several concurrent scripts using the same debugging session, just use the same $sTitle when calling _DebugSetup(). All _DebugOut() will go to the same debugging session.
Commenting out the _DebugSetup() call will effectively disable all the calls to _Debug...(), but you may want to remove the calls to all _Debug...() functions before making a release version of your script.
If the "Report Log Window" type is used then the script will end only when closing the report window.
If the "Report Notepad Window" type is used the Notepad window cannot be closed when running under Windows 11 without asking to register it.
So the content of the window is put in the Clipboard and a MsgBox will display it before the closing of the script.
If the script is run in Admin mode the old Notepad will be used as for Windows 10 (see example 2).
_DebugOut, _DebugReport, _DebugReportEx, _DebugReportVar
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.2.8.1
Author: David Nuttall
Script Function:
Base script to show functionality of Debug functions.
#ce ----------------------------------------------------------------------------
#include <Debug.au3>
_DebugSetup ("Check Excel",True ); start displaying debug environment
For $i= 1To 4
WinActivate ("Microsoft Excel")
; interact with Excel
Send ("{Down}")
_DebugOut ("Moved Mouse Down"); forces debug notepad window to take control
Next
; will allow to run with old Notepad behaviour in Window 11 #RequireAdmin #include <Debug.au3> _DebugSetup ("Check Excel",True ,5); Report Notepad Window For $i= 1To 4 WinActivate ("Microsoft Excel") ; interact with Excel Send ("{Down}") _DebugOut ("Moved Mouse Down"); forces debug notepad window to take control Next