All pastes #947399 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-18 13:58 UTC
rendered paste body
Func _ErrorCheckLog($checkStr, $max)
	$loglines = _FileCountLines($aolog)
	$count = 0

	If $loglines > $max+1 Then
		$loglines -= $max+1
		$logfile = FileOpen($aolog, 0)
		FileReadLine($logfile, $loglines)
		If @error = 0 Then
			For $i = 1 to $max
				If StringInStr(FileReadLine($logfile), $checkStr) Then
					$count += 1
				EndIf
			Next
		EndIf
		
		FileClose($logfile)
		
		If $count >= $max Then
			return True
		Else
			return False
		EndIf
	EndIf
EndFunc