 }
 
 ;############################### Functions ###############################
+HasVal(haystack, needle) {                                              ;HasVal function from https://autohotkey.com/boards/viewtopic.php?p=109617#p109617
+    for index, value in haystack
+        if (value = needle)
+            return index
+    if !(IsObject(haystack))
+        throw Exception("Bad haystack!", -1, haystack)
+    return 0
+}
+
 ParsingDemofiles(RenamingMaskNumber, counter_files_quotient)
 {
     Loop, Files, *.dem

        GuiControl,, ProgressBar, 0
        GuiControl,, text_prog, Extracting mapname
        GuiControl, Enable, RenamingMaskNumber
        GuiControl, Enable, Cancel
        GuiControl, Enable, Start
        return

Gui, Add, Text, x12 y70 w290 h40 vtext_example, Example: `n"samurai-vs-ninja.dem" will be renamed to "samurai-vs-ninja_de_dust2.dem"

Gui, Add, Progress, x12 y140 w290 h10 Backgroundsilver vProgressBar
Gui, Add, Checkbox, x12 y157 w290 h20 vOption_1, Parsing full demofile (processing intese)
; Generated using SmartGUI Creator for SciTE
Gui, Show, w323 h221, %PrgName%
return
