-
Notifications
You must be signed in to change notification settings - Fork 71
/
WS_RemoveErrChk.ahk
62 lines (51 loc) · 1.04 KB
/
WS_RemoveErrChk.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
blnIsErrorChecking := False
blnNextLineState := False
FileDelete, ws4ahk--err.ahk
Loop, Read, ws4ahk.ahk, ws4ahk--err.ahk
{
blnIsErrorChecking := blnNextLineState
If (LineBeginsErrorChecking(A_LoopReadLine))
{
If !blnIsErrorChecking
{
blnIsErrorChecking := True
blnNextLineState := True
}
Else
{
Msgbox % "Error at line " A_Index "`nAlready error checking."
Return
}
}
If (LineEndsErrorChecking(A_LoopReadLine))
{
If blnIsErrorChecking
blnNextLineState := False
Else
{
Msgbox % "Error at line " A_Index "`nAlready not error checking."
Return
}
}
If (A_Index = 1)
FileAppend, `;`; Error checking removed %A_MM%\%A_MDAY%\%A_YEAR%`n
If (!blnIsErrorChecking)
FileAppend, %A_LoopReadLine%`n
}
If blnIsErrorChecking
Msgbox % "Error checked the rest of the file to oblivion."
Return
LineBeginsErrorChecking(sLine)
{
If (InStr(sLine, "#BeginErrorChecking"))
Return True
Else
Return False
}
LineEndsErrorChecking(sLine)
{
If (InStr(sLine, "#EndErrorChecking"))
Return True
Else
Return False
}