Stderr

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jpginc
Posts: 124
Joined: 29 Sep 2013, 22:35

Stderr

10 Oct 2013, 07:24

I'm going to dynamically modify the code of my running script but I want to check if there are any syntax errors before reloading. Can anyone tell me whats wrong with this?
code := "msgbo, this shouldn't compile"
FileAppend, % "#ErrorStdOut`nexitapp`n" code, % A_ScriptDir "\JPGIncTempFile.ahk"
RunWait, %A_AhkPath% /ErrorStdOut "%A_scriptdir%\JPGIncTempFile.ahk" <"%A_scriptdir%\errorlog.txt"
FileRead, errorlog, % A_ScriptDir "\errorlog.txt"
msgbox % errorlog
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Stderr

10 Oct 2013, 11:49

RunWait, %ComSpec% /c start /b /wait "" "%A_AhkPath%" /ErrorStdOut "%A_ScriptDir%\JPGIncTempFile.ahk" 2>"%A_scriptdir%\errorlog.txt",, Hide
=============================

btw, why this doesn't work: :?
RunWait, %ComSpec% /c "%A_AhkPath%" /ErrorStdOut "%A_ScriptDir%\JPGIncTempFile.ahk" 2>"%A_scriptdir%\errorlog.txt",, Hide
Last edited by tmplinshi on 10 Oct 2013, 15:06, edited 1 time in total.
Zelio
Posts: 278
Joined: 30 Sep 2013, 00:45
Location: France

Re: Stderr

10 Oct 2013, 14:40

I think it is a missing " " to create a great block, we can see red character in documentation, maybe old legacy and confusing with expression
RunWait, %ComSpec% /c ""%A_AhkPath%" /ErrorStdOut "%A_ScriptDir%\JPGIncTempFile.ahk" 2> "%A_scriptdir%\errorlog.txt""
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Stderr

10 Oct 2013, 15:02

Thanks, Zelio! That works.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: peter_ahk, TAC109 and 352 guests