| View previous topic :: View next topic |
| Author |
Message |
hutch@edge.net
Joined: 16 Sep 2008 Posts: 77
|
Posted: Mon Aug 24, 2009 7:31 pm Post subject: "Step Through" an AHK Script |
|
|
Greetings, Gurus.
Is there a built-in function or 3rd part utility that will allow you to "step through" an AHK script, like the F8 function in VBA? Or is ther another means of error checking the scripts?
Thanks in advance. |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Mon Aug 24, 2009 8:01 pm Post subject: |
|
|
I typically use a MsgBox to stop the code after certain lines & check results. _________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
randallf
Joined: 06 Jul 2009 Posts: 678
|
Posted: Mon Aug 24, 2009 8:03 pm Post subject: |
|
|
Is there a way to execute code from a variable?
Could you do this with Loop, Read?
Can you just force it on a line?
% ThisLine% |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Mon Aug 24, 2009 8:51 pm Post subject: |
|
|
my internet connection isn't good enough for me to dig up links, but useful search terms:
run AHK dynamically with pipes
autohotkey.dll
Lexikos' custom ahk build AutohotkeyL
Autohotkey terminal
Also, many built-in tools are sufficient: msgbox, tooltip, listvars, pause, listlines, etc. _________________
(Common Answers) |
|
| Back to top |
|
 |
hutch@edge.net
Joined: 16 Sep 2008 Posts: 77
|
Posted: Mon Aug 24, 2009 10:20 pm Post subject: |
|
|
Thanks for the response, guys. My previous searches on error checking and step into/trhough didn't turn up anything useful. I'll try the terms you suggested.
Have a good one. |
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5334 Location: San Diego, California
|
Posted: Mon Aug 24, 2009 10:54 pm Post subject: |
|
|
@hutch@edge.net
search for 'OutputDebug' in the helpfile for other ideas
Edit: poor design in original, useless way to report line number
| Code: | ; add the debug = 1 line to force the 'breakpoint'
debug=1 ;
if (debug=1) debugger("test",A_LineNumber) |
| Code: | ; insert just this line and if Win-Q is pressed, the next line will be true if/when executed
if (debug=1) debugger("test",A_LineNumber) |
| Code: | ;============================================================
; very rudimentary debugger
;============================================================
;search for 'OutputDebug' in the helpfile for other ideas
debugger(text,linenum)
{
; listlines ; I don't seem to be able to show both variables and lines
; so I'll report the line number and look at the file listing instead
listvars
msgbox %text%`nline=%linenum% Paused by user, `n`nPress OK to continue
debug:=0
return
}
; simple variable to allow pausing the script
#q:: ; Win-Q
debug=1
return |
|
|
| Back to top |
|
 |
|