By
232showtime
Hello World!!!
this is the first time I use Error checking and Im really confused with this, am I doing it correctly?.
I check the help file and came up with this
#include <MsgBoxConstants.au3>
;1st example
Local $hWndR = wtf(WinExists("[CLASS:CalcFrame]"))
If @error Then
MsgBox($MB_SYSTEMMODAL, "Error", "calculator does not Exist!!!")
Else
MsgBox($MB_SYSTEMMODAL, "Result", "calculator Exist!!!")
EndIf
Exit
Func wtf($hWndR)
If $hWndR < 1 Then
SetError(2);where did you get this "2"
ElseIf $hWndR > 1 Then
SetError(1); and this "1"
EndIf
Return $hWndR
EndFunc ;==>wtf
;~ 2nd Example
Local $hWndR = wtf(WinExists("[CLASS:CalcFrame]"))
If Not @error Then
MsgBox($MB_SYSTEMMODAL, "Error", "calculator does not Exist!!!")
ElseIf @error Then
MsgBox($MB_SYSTEMMODAL, "Result", "calculator Exist!!!")
EndIf
Exit
Func wtf($hWndR)
If $hWndR = 1 Then
SetError(2)
ElseIf $hWndR = -1 Then
SetError(1)
EndIf
Return $hWndR
EndFunc ;==>wtf
Please can someone enlighten me...