AutoHotkey Community

It is currently May 26th, 2012, 8:38 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: August 24th, 2009, 8:31 pm 
Offline

Joined: September 16th, 2008, 7:53 pm
Posts: 77
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 9:01 pm 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
I typically use a MsgBox to stop the code after certain lines & check results.

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 9:03 pm 
Offline

Joined: July 6th, 2009, 9:58 pm
Posts: 678
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%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 9:51 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
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.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 11:20 pm 
Offline

Joined: September 16th, 2008, 7:53 pm
Posts: 77
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 11:54 pm 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6065
Location: San Diego, California
@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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, joetazz, Leef_me, Mickers, tidbit, tomoe_uehara and 58 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group