Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Help with "ErrorLevel=0"


  • Please log in to reply
1 reply to this topic
ertagon2
  • Members
  • 1 posts
  • Last active: Jan 01 2016 02:36 PM
  • Joined: 22 Oct 2015

Hi so i found this in an another topic and there is a comment to the ErrorLevel that 0 indicates that the process is not running therefore there is an error level but here http://ahkscript.org.../ErrorLevel.htmthey said that 0 indicates that there is no error level. Can anyone explain this to me ? Soory if there are any english misteakes ;/

 


Process, Exist, Printkey2000.exe ; check to see if Printkey.exe is running
If (ErrorLevel = 0) ; If it is not running
    
{
    Run, Printkey2000.exe
    msgbox
Program was not running.
    }
Else ; If it is running, ErrorLevel equals the process id for the target program (Printkey). Then close it.
    {
    Process, Close, %ErrorLevel%
    msgbox Closed process %ErrorLevel%
    }



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
A value of 0 usually indicates success,

usually = not always.

 

 

Exist: Sets ErrorLevel to the Process ID (PID) if a matching process exists, or 0 otherwise.

A value of 0 does not mean that Process Exist had an error; it only means that the process does not exist.

 

ErrorLevel is just a variable.  You can even set it yourself, to whatever you want.