 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| DO WANT!? |
| YESH! |
|
57% |
[ 4 ] |
| NESH! |
|
14% |
[ 1 ] |
| DO NOT KNOW? |
|
0% |
[ 0 ] |
| TITS OR GTFO! |
|
28% |
[ 2 ] |
|
| Total Votes : 7 |
|
| Author |
Message |
Ice_Tea
Joined: 12 Jan 2008 Posts: 131
|
Posted: Mon Jul 27, 2009 7:02 pm Post subject: #Debug + OutputDebug |
|
|
Hey, just got a great idea, since BigVent gave tips to new ppl.
He mentioned that one could put Msgbox all over the code to tell what's happening, and i recommended outputdebug as it isn't super duper important that you remove it afterwards. and it's also simple to remove later as you could use Search and Replace functions that a lot of text editors has, to comment out the outputdebug lines...
So i thought why not go further:
| Code: | #Debug 1
OutputDebug, Yaye this text will appear |
| Code: | #Debug 0
OutputDebug, OH LAWD WHAT HAVE YOU DONE ;will not appear |
Basically, before the script executes, it will decide whether or not it should include those outputdebug lines
Also, optionally you could add a DbgMsgbox
for ppl who prefer that box popping up...
;sry couldn't bother with writing a 'proper' post, very sorry if I'm doing it wrong... _________________
 |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Wed Jul 29, 2009 11:42 am Post subject: |
|
|
| If you don't have a program running, listening for debug messages, OutputDebug won't do anything. Furthermore, it is easy to write a wrapper function which calls OutputDebug/MsgBox if a global flag is set, and does nothing otherwise. There is no need for a "#Debug" directive. |
|
| Back to top |
|
 |
Ice_Tea
Joined: 12 Jan 2008 Posts: 131
|
Posted: Wed Jul 29, 2009 8:55 pm Post subject: |
|
|
| Lexikos wrote: | | If you don't have a program running, listening for debug messages, OutputDebug won't do anything. Furthermore, it is easy to write a wrapper function which calls OutputDebug/MsgBox if a global flag is set, and does nothing otherwise. There is no need for a "#Debug" directive. |
Yeah, that may be true... Maybe, some day, I will write a script to do the search and replace stuff <_<... Kinda wanted all this to be processed before the script launches, so that there isn't any 'unnecessary slowdown'... _________________
 |
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 748 Location: Texas, USA
|
Posted: Wed Jul 29, 2009 10:29 pm Post subject: |
|
|
| Ice_Tea wrote: | | Maybe, some day, I will write a script to do the search and replace stuff <_<... Kinda wanted all this to be processed before the script launches, so that there isn't any 'unnecessary slowdown'... |
I had the same idea a many moons back. That's why I put in a request for a new NOP (No operation) command. No one was interested. My idea, similar to yours, was to do a mass replace of the outputdebug command with NOP before moving the script to production. Leaving the NOP commands in the script makes it very easy to reverse the search/replace and it keeps the script line numbers intact for debugging.
Oh well. C'est la vie. |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7295 Location: Australia
|
Posted: Thu Jul 30, 2009 7:03 am Post subject: |
|
|
OP:
| Code: | OutputDebug, This might do something.
| NOP:
| Code: | ;OutputDebug, This won't do anything...
|
| Quote: | | Kinda wanted all this to be processed before the script launches, so that there isn't any 'unnecessary slowdown'... | It is negligible.
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|