When I put a msg box or traytip dialog into the while loop, it keeps bringing that up, so for some reason it's not exiting out of the loop. Right now, sum1.txt is empty so FileReadLine should be setting @error to -1 (Since it's reaching the end of the file without finding the appropriate value).
Let me know what you think!
$checksum1 = PixelChecksum(385, 70, 410, 300) $file1 = FileOpen("sum1.txt", 0) SetError(0) While $value1 = 0 $line = String(FileReadLine($file1)) If @error = -1 Then ExitLoop If @error = 1 Then ExitLoop If _IsAcceptable($checksum1, $line) = 1 Then $value1 = StringLeft($line, 2) EndIf WEnd If @error = -1 Then $value1 = InputBox("Value 1", "Please enter value #1") FileWriteLine($file1, $value1 & ": " & $checksum1) $value1 = StringLeft($value1, 2) EndIf Func _IsAcceptable($sNumber, $sString) If StringInStr($sString, String($sNumber)) Then Return 1 Return 0 EndFunc ;==>_IsAcceptable




