33;
44PreprocessScript(ByRef ScriptText, AhkScript, Directives, PriorLines
55, FileList := "" , FirstScriptDir := "" , Options := "" , iOption := 0 )
6- { global DirDoneG, PriorLine
6+ { global DirDoneG, PriorLine, MjrVn
77 SplitPath , AhkScript, ScriptName, ScriptDir
88 if ! IsObject (FileList)
99 {
@@ -18,7 +18,7 @@ PreprocessScript(ByRef ScriptText, AhkScript, Directives, PriorLines
1818 oldLineFile := DerefIncludeVars.A_LineFile
1919 DerefIncludeVars.A_LineFile := AhkScript
2020
21- if SubStr (DerefIncludeVars. A_AhkVersion , 1 , 1 )= 2 ; Handle v2 default folder
21+ if (MjrVn ! = 1 ) ; Handle v2+ default folder
2222 { OldWorkingDirv2 := A_WorkingDir
2323 SetWorkingDir %ScriptDir%
2424 }
@@ -54,7 +54,7 @@ PreprocessScript(ByRef ScriptText, AhkScript, Directives, PriorLines
5454 else if StrStartsWith(tline, " /*" )
5555 { if StrStartsWith(tline, " /*@Ahk2Exe-Keep" )
5656 cmtBlock := 2
57- else if ! (SubStr (DerefIncludeVars. A_AhkVersion , 1 , 1 )= 2 && tline~ = " \*/$" )
57+ else if ! (MjrVn ! = 1 && tline ~ = " \*/$" )
5858 cmtBlock := 1
5959 continue
6060 } else if (cmtBlock = 2 && StrStartsWith(tline, " */" ))
@@ -144,8 +144,7 @@ PreprocessScript(ByRef ScriptText, AhkScript, Directives, PriorLines
144144 Util_Error(" Error: #Delimiter is not supported." , 0x22 )
145145 else
146146 ScriptText .= (contSection ? A_LoopReadLine : tline) " `n"
147- } else if (tline~ =" ^\*/"
148- || SubStr (DerefIncludeVars.A_AhkVersion ,1 ,1 )=2 && tline~ =" \*/$" )
147+ } else if (tline~ =" ^\*/" || MjrVn ! = 1 && tline~ =" \*/$" )
149148 cmtBlock := 0 ; End block comment
150149 } ; End file-read loop
151150 Loop , % !! IsFirstScript ; Like "if IsFirstScript" but can "break" from block
@@ -191,7 +190,7 @@ PreprocessScript(ByRef ScriptText, AhkScript, Directives, PriorLines
191190 IfExist , %ilib%
192191 { FileGetSize wk, %ilib%
193192 if wk > 3
194- { if SubStr (DerefIncludeVars. A_AhkVersion , 1 , 1 )= 1
193+ { if (MjrVn ! = 1 )
195194 { Loop 4 ; v1 - Generate random label prefix
196195 { Random wk, 97 , 122
197196 ScriptText .= Chr (wk) ; Prevent possible '#Warn Unreachable'
@@ -210,7 +209,7 @@ PreprocessScript(ByRef ScriptText, AhkScript, Directives, PriorLines
210209 if OldWorkingDir
211210 SetWorkingDir , %OldWorkingDir%
212211
213- if SubStr (DerefIncludeVars. A_AhkVersion , 1 , 1 )= 2 ; Handle v2 default folder
212+ if (MjrVn ! = 1 ) ; Handle v2+ default folder
214213 SetWorkingDir %OldWorkingDirv2%
215214}
216215; --------------------------- End PreprocessScript -----------------------------
0 commit comments