Jump to content

RichardR

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by RichardR

  1. Thanks for explaining how @error works. I have looked at the help file many times. The MsgBox function didn't mention anything about setting the @error so I thought, at first, it had nothing to do with it. After reading about SetError, it seems that entering a function resets @error to 0. It also mentioned I should try storing @error in a variable which I already did. Thanks.
  2. Hello. In my script I find that using the following code runs eternally because @error is always 0 even when it shouldn't be. Func test() Local $t = 90, $c = 0, $ps Do $ps = PixelSearch(570, $t, 590, $t + 15, 0xCCD0D6, 15, 1, $Hwnd) MsgBox(0, "test", IsArray($ps) & ", " & "error = " & @error, 0, $Hwnd) If (@error = 0) Then $t += 25 $c += 1 EndIf Sleep(100) MsgBox(0, "test", "error = " & @error, 0, $eveHwnd) Until @error = 1 Return $c EndFunc The message box shows me that PixelSearch found something 4 times; but after that, isArray returns false but @error is also 0. This doesn't happen with a While...Wend loop. Any thoughts?
×
×
  • Create New...