Jump to content


The Run Command Does Not Set ErrorLevel for Blank Value


  • Please log in to reply
1 reply to this topic

#1 Guests

  • Guests

Posted 08 January 2012 - 05:13 PM

Hi,

This causes an error message, which is good.
run,,, UseErrorLevel
if ErrorLevel
	msgbox error
else
	msgbox ok

This doesn't cause an error message but sets the ErrorLevel, which is also good.
var := "asd"
run, % var,, UseErrorLevel
if ErrorLevel
	msgbox error
else
	msgbox ok

However, this does not set the ErrorLevel, that I think it should.
var := ""
run, % var,, UseErrorLevel
if ErrorLevel
	msgbox error
else
	msgbox ok


#2 Lexikos

Lexikos
  • Administrators
  • 8832 posts

Posted 09 January 2012 - 08:14 AM

It is impossible to fail to run nothing. From the source code:
// Launching nothing is always a success:
	if (!aAction || !*aAction) return OK;
Completely omitting the parameter is different, since that is a mandatory parameter. This is (or should be) handled consistently across all commands with mandatory parameters.