Jump to content

Recommended Posts

Posted (edited)

the files does have a duplicate function name, but that is not the problem for you. Your problem is how it looks in the console no displaying the characters in your SciTE editor that is not even from this site, right ?

Ok, so the redirect also gives the ?? instead of the characters.

No clue 🤷‍♂️

Edited by argumentum
🤷‍♂️

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted
21 minutes ago, argumentum said:

the files does have a duplicate function name, but that is not the problem for you. Your problem is how it looks in the console no displaying the characters in your SciTE editor that is not even from this site, right ?

Ok, so the redirect also gives the ?? instead of the characters.

No clue 🤷‍♂️

yes,it is.

Posted (edited)
#include <AutoItConstants.au3>
#include <FileConstants.au3>

; Define files
Local $scriptFile = "测试.au3"
Local $logFile = "1.txt"

Local $pid = Run('"' & @AutoItExe & '" /ErrorStdOut "' & $scriptFile & '"', @ScriptDir, @SW_HIDE, $STDOUT_CHILD + $STDERR_CHILD)

ProcessWaitClose($pid)

Local $output = StdoutRead($pid) & StderrRead($pid)
FileWrite($logFile, $output)

ShellExecute($logFile)

1.txt

"D:\_Test\??.au3" (4) : ==> Duplicate function name.:
Func test()

 

Edited by ioa747
add 1.txt

I know that I know nothing

Posted (edited)

I can't solve the problem, I can only overcome it.

Local $originalFile = "测试.au3"
Local $tempFile = "temp_syntax_check.au3"
Local $logFile = "1.txt"

FileCopy($originalFile, $tempFile, 1)

Local $pid = Run('"' & @AutoItExe & '" /ErrorStdOut "' & $tempFile & '"', @ScriptDir, @SW_HIDE, 8) ; $STDERR_MERGED
ProcessWaitClose($pid)
Local $output = StdoutRead($pid) & StderrRead($pid)

$output = StringReplace($output, $tempFile, $originalFile)

Local $hFile = FileOpen($logFile, 2 + 128) ; $FO_OVERWRITE + $FO_UTF8
FileWrite($hFile, $output)
FileClose($hFile)

FileDelete($tempFile)
ShellExecute('notepad.exe', $logFile)

1.txt

"D:\_Test\测试.au3" (4) : ==> Duplicate function name.:
Func test()


alternative

Local $scriptFile = "测试.au3"
Local $logFile = "1.txt"

; Run Au3Check - It's designed for exactly this job
Local $pid = Run('"' & StringReplace(@AutoItExe, "AutoIt3.exe", "Au3Check.exe") & '" "' & $scriptFile & '"', @ScriptDir, @SW_HIDE, 8) ; $STDERR_MERGED

ProcessWaitClose($pid)
Local $output = StdoutRead($pid) & StderrRead($pid)

; Write the output
Local $hFile = FileOpen($logFile, 2 + 128)  ; $FO_OVERWRITE + $FO_UTF8
FileWrite($hFile, $output)
FileClose($hFile)

ShellExecute($logFile)

1.txt

AutoIt3 Syntax Checker v3.3.18.0  Copyright (c) 2007-2025 Tylo & AutoIt Team

"测试.au3"(4,12) : error: test() already defined.
Func test()
~~~~~~~~~~~^
测试.au3 - 1 error(s), 0 warning(s)

 

Edited by ioa747

I know that I know nothing

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
×
×
  • Create New...