esfalk Posted April 7, 2004 Posted April 7, 2004 I'm trying to throw together a bit of a crude debugging tool, and had a question about calling out the current line of the script. I'm pretty sure it's possible because the TrayIconDebug can output the line number it's currently processing. I'd like to have a little function like: ; Func to output current line Func _Line ( ) MsgBox ( 48, "Update", "Current Line: " & @CurrentLine*, 1 ) EndFunc ; --> _Line @CurrentLine* is what I'd like to replace with a real command or function. Basically, I'd like to call _Line throughout the code to display for a second which line it's on... kind of like informing me of it's progress so I can narrow down where it fails. Thanks
trids Posted April 7, 2004 Posted April 7, 2004 It's a nice idea but, speaking under correction here, I think the tray icon debug's display of the line number is at a lower level than the code-logic:Your UDF would always display the same number .. the line where this statement appears: MsgBox ( 48, "Update", "Current Line: " & @CurrentLine*, 1 )
esfalk Posted April 7, 2004 Author Posted April 7, 2004 Ack! You would be correct... how's about this? ... ; Script $VAR = @CurrentLine* _Line ( $VAR ) ; Script ... ; Func to output current line Func _Line ( $VAR ) MsgBox ( 48, "Update", "Current Line: " & $VAR, 1 ) EndFunc; --> _Line
trids Posted April 7, 2004 Posted April 7, 2004 (edited) You can accomplish that already with a checkpoint UDF .. ;code code code ;code code code ;code code code _CheckPoint("Here i am") ;code code code ;code code code ;code code code _CheckPoint("Now I'm here, and $sSomeValue = " & $sSomeValue) ;code code code ;code code code ;code code code Func _CheckPoint($psComment) MsgBox(4096 + 32, @ScriptName & ":: _Checkpoint()", $psComment, 1) EndFuncI think (hope, pray ) Nutster is still working on a debugger. You might have some ideas you can add here .. Edited April 7, 2004 by trids
Nutster Posted April 21, 2004 Posted April 21, 2004 I have submitted a bunch of things to Jon and I am waiting for the next version (3.0.103) before getting into it deeply because some of the things I wrote optimize the process at a pretty deep level, that would interfere with the way the debugger would work. That and work is just burying me in stuff to do. Guess where I am this weekend? David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd...
scriptkitty Posted April 21, 2004 Posted April 21, 2004 well if you really want a display, you can have autoit make a temp autoit file and run that. Ex: $file = FileOpen("test.au3", 0); what ever your autoit file $tempfile="my_temp_file.au3" FileDelete($tempfile) $_x=1 ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop filewriteline($tempfile,'tooltip("Line '&$_x &' ",0,0)') filewriteline($tempfile, $line) $_x=$_x+1 Wend FileClose($file) Run('cmd /c start '&$tempfile) Ok, I am just having fun, and it wouldn't work if you use tooltip in your script, but this will make a quick debug while running script. AutoIt3, the MACGYVER Pocket Knife for computers.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now