Jump to content

#AutoIt3Wrapper_Run_Debug_Mode=Y


Recommended Posts

I didn't even know that option existed.

I found the following post about Opt("TrayIconDebug") not working on compiled EXEs:

http://www.autoitscript.com/forum/index.php?showtopic=100523&view=findpost&p=718769

Compiled scripts doesn't have any sense of "lines" so that isn't possible to know. Just run the uncompiled script to find any errors

As far as debugging, you can either compile as a CLI program, and do some consolewrites at various stages of your program's execution, or use a Filewriteline() to save that information directly to a file, or look at this:

http://www.autoitscript.com/forum/index.php?showtopic=95595&view=findpost&p=705917

Further, the macro @ScriptLineNumber will return -1 if the script is compiled.

Edited by TurionAltec
Link to comment
Share on other sites

If you are just testing it and it won't be included in the final release, you can use this. It's pretty cool and useful. It is like console write to an edit control in another program.

Func dbg($msg)
    ;use debugview from sysinternals
    ;http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx        Download
    ;http://msdn.microsoft.com/en-us/library/ms679303(VS.85).aspx        Functions
    DllCall("kernel32.dll", "none", "OutputDebugString", "str", $msg)
EndFunc   ;==>dbg
Link to comment
Share on other sites

I would be thinking of redirecting the stdout to a text file but not sure how to do that but I think I saw that asked and answered recently.

In the FAQ there is a program that ConsoleWrites every line of your code but that just suffs up your code.

I would like to know how to get "#AutoIt3Wrapper_Run_Debug_Mode=Y" working for programs that use more then one file.

Edit: Ha! The redirect post was TurionAltec's!

Edited by bo8ster

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

I knocked up something quick, not tested in all cases. This will capture everything from output window of Scite.

This works using two scripts, one is your normal script you want to capture the output from and the other is used to capture the output.

I have used a msgbox but you can replace that with a FileWrite.

Script One - My custom script where I want to save the output. Fancy I know! Note Comments are not written using #AutoIt3Wrapper_Run_Debug_Mode=Y

#AutoIt3Wrapper_Run_Debug_Mode=Y
AutoItSetOption("SendKeyDelay", 90);
AutoItSetOption("MustDeclareVars", 1)

ConsoleWrite(@CRLF & @CRLF & " Hello world" & @CRLF & " This is a test" & @CRLF & @CRLF)

;~ End of script
Exit

Script Two - Used to execute and capture the output of Script One. Most of it I copied from the help file. The run cmd I got from Scite when Pressing F5. I believe everything comes from STDOUT so STDERR is not really required but its there.

#include <Constants.au3>

Local $foo = Run('"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\<....>\workspace.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams', @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)

Local $line
While 1
    ProcessWaitClose($foo)
    $line = StdoutRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDOUT read:", $line)
    
Wend

While 1
    ProcessWaitClose($foo)
    $line = StderrRead($foo)
    If @error Then ExitLoop
    MsgBox(0, "STDERR read:", $line)
Wend

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...