I would like to get my tail function to grab the last line in logfile and turn it into a number. So that I can then use it in a if condition.
file = C:\Users\%A_UserName%\Documents\logTime.txt
Tail(k,file) ; Return the last k lines of file
{
Loop Read, %file%
{
i := Mod(A_Index,k)
L%i% = %A_LoopReadLine%
}
L := L%i%
Loop % k-1
{
IfLess i,1, SetEnv i,%k%
i-- ; Mod does not work here
L := L%i% "`n" L }
;Return L
;msgbox % Tail(1,file)
}
The if condition
While (PrLoad > 5 ) ; Assign the Number you want.
{
If (Tail(1, file) = %A_Hour%%A_Min%)
{
msgBox is equal to Current Time %Tail(1, file)%
Sleep 60000
}
Else if (Tail(1, file) > %A_Hour%%A_Min% )
{
msgBox Tail(1, file) is greater then %A_Hour%%A_Min%
Sleep 60000
}
Logfile is being made by the following:
FileAppend, %A_Hour%%A_Min%`n, C:\Users\%A_UserName%\Documents\logTime.txt
I am as sure im passing the function wrong into the if condition..%L%
how can I turn the string into a number to be compared by the if statments?