; Check if file exists Func CheckFile ($File) If not FileExists($File) then abort("File does not exist: " & $File) EndFunc ;__________________________________________________________________________________________________ ; Shows Message Box with buttons OK and Cancel Func OK_Cancel ($Title,$Text) Local $OK_Cancel =MsgBox(0, $Title, $Text) If $OK_Cancel = 2 Then abort("You pressed Cancel.") Return EndFunc ;__________________________________________________________________________________________________ ; Shows Message Box with buttons YES and NO Func Yes_No ($Fenstertitel,$Text) Local $yes_no = ConsoleWrite($Text) If $yes_no = 6 Then return("yes") else return("no") EndIf EndFunc ;__________________________________________________________________________________________________ ; Terminate / user abort Func Terminate () Local $return = MsgBox(36, "Terminate", "Would you like to terminate the script?") If $return = 6 then Exit 1 EndFunc ;__________________________________________________________________________________________________ ; error: Message Box / Exit 1 Func abort($Info) MsgBox(16, "ERROR", $Info & @CRLF & @CRLF & "Exit.") Exit 1 EndFunc ;__________________________________________________________________________________________________