From my POV, the issue occurs whenever SetError isn't the last executed statement prior to returning from the function. It's like AutoIt detects that @error was set by something other than SetError (it was originally set by SetError, but then reset by ConsoleWrite), and therefore doesn't pass these error values to the calling routine.
Next version of SciTE will be out soon (SciTE 5.3.9) with:
They were both pretty minor changes and Neil was willing to put them both in. The second one was a Mod I've put in many moons ago so can rip that out now.
Will do a build somewhere next week after it is released.
I am not sure why you want this change as it will now remove one space as result when there's already a space Infront. Could you explain why this is usefull?
I think none contested that SetError() works properly but how @error is set in different circumstances and according with what it's stated in help file.
lol, I was not
FuncTest()
ConsoleWrite( "After FuncTest Call. @error is " & @error & @CRLF )
Func FuncTest()
ConsoleWrite("AutoItVersion = v" & @AutoItVersion & @CRLF)
SetError(2) ; <--- this does not behave as expected
ConsoleWrite('FuncTest: inner check: ' & @error & @CRLF) ; this behaves as expected in version 3.3.16.1
ConsoleWrite('FuncTest: inner check: ' & @error & @CRLF)
ConsoleWrite('FuncTest: inner check: ' & @error & @CRLF) ; but not in version 3.3.14.5 ( irrelevant )
Return ; SetError(2) ; <--- it should be the same as if placed here, but is not.
EndFunc ;==>FuncTest
yes, the SetError() is not behaving as expected. I call BS bug !
Edit: The way it works lead me to misinterpret it.
Hi,
compile a program "Get_Discord_Status_loaded_64Bit.exe" as a 64bit-application.
Write the status into a file or return it elsewhere....
Compile a program "Get_Steam_Status_loaded_32Bit.exe" as a 32bit-application.
Write the status into a file or return it elsewhere....
Compile your program as a 32/64bit-Application and evaluate the status from the file.
i updated my autoit and have overwritten nomad memory. i just updated a steam manager for switching between accounts. with process hacker you can watch which modules loaded when starting steam. example. if friendsui.dll is loaded, you can be 100% sure that steam login was successful. no other great chance to check this.
so...open process memory from steam.exe. get baseadresse from friendsui.dll. when true, steam logged in.
i also do this with chrome, keepassxc, or discord to get states that normally not possible.
but here it comes down to one big question. discord is a 64bit application and steam a 32bit application . how can i get base adresse from both?
If i compile autoit in 32 bit i can get baseadress of steam but not discord.
If i compile autoit in 64 bit i can get baseadress of discord but not steam.
Func GUICtrlGetPos($iControlID)
Local $a = ControlGetPos(GUICtrlGetHandle($iControlID),"",0)
If @error Then
Local $a[4]=[-1,-1,-1,-1]
Return SetError(1,0,$a)
EndIf
Return SetError(0,0,$a)
EndFunc