Search the Community
Showing results for tags 'seterror'.
-
Hi, Im kind of confused with seterror, If I put Sleep SetError is working fine, but without sleep set error doesn't work. please can someone give me a good and easy example. TIA Parameters: code = I don't really understand this, is it ok to put any numbers??? or some numbers represent something? extended = same situation, is it ok to put any integer??? #include <Array.au3> #include <File.au3> $sFilePath = "C:\New Folder" $FLTAR = _FileListToArrayRec($sFilePath = "", "*.pdf", $FLTAR_FILES, $FLTAR_NORECUR, $FLTAR_SORT, $FLTAR_FULLPATH) If @error Then $FLTAR = SetError(1, 0, "0 files for transfer") Sleep(100) If $FLTAR = @error Then MsgBox(0, "$FLTARIf", $FLTAR) Else MsgBox(0, "$FLTARElse", "SUCCESS") EndIf I used 1 and 0 for testing only.
-
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...