- I literally had this idea just now.
- The WarningMode for #Warn could point to a function. And the function would receive the debug info and could then take appropriate action.
- E.g. I would set it up to record previous debug messages, filtering out repeated info (e.g. an undeclared variable at line X), and append certain messages to a file, and show a Progress window and/or play a SoundBeep based on certain conditions.
OnWarn
Re: OnWarn
Some of the warnings are shown before any script (static initializers and the auto-execute section) are executed. These and all other warnings can be handled by an external process using the StdOut method or a DBGp client using the OutputDebug method.
Re: OnWarn
- Ah yes, those initial messages would be missed.
- I'll have to perfect this:
retrieve OutputDebug text - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=58069
- And/or resolve this:
#Warn: get StdOut from another script - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=58985
- Thanks.
- I'll have to perfect this:
retrieve OutputDebug text - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=58069
- And/or resolve this:
#Warn: get StdOut from another script - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=58985
- Thanks.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: OnWarn
- Actually, an OnWarn function would still be useful if it missed initial errors, in the same way that OnError does.
- I don't mind using DebugView to test scripts when they load, but keeping a script/program open to monitor other scripts is somewhat of a burden.
- An example use case. If you have a loop, where if (var = "") is checked, but where var was never defined, that causes a #Warn error message every time, a custom function could record/report that error once only.
- (Also, external programs like DebugView have the disadvantage of receiving messages from multiple programs, not just AutoHotkey.)
- I don't mind using DebugView to test scripts when they load, but keeping a script/program open to monitor other scripts is somewhat of a burden.
- An example use case. If you have a loop, where if (var = "") is checked, but where var was never defined, that causes a #Warn error message every time, a custom function could record/report that error once only.
- (Also, external programs like DebugView have the disadvantage of receiving messages from multiple programs, not just AutoHotkey.)
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Who is online
Users browsing this forum: No registered users and 25 guests