Ideesuche für Alternative

  • Moin moin...

    Hab hier eine Func geschrieben, die im Vorfeld der eigentlichen GUI abläuft und den User 2 Entscheidungen abverlangen soll.

    Bedingungen:
    Es gibt 2 Textfiles, die Voreinstellungen enthält.
    1. Preconditions.txt
    2. Environments.txt

    Die Reporter.txt wird in jedem Fall ausgelesen oder bei der nächsten Sicherung geschrieben. Diese bleibt daher aussen vor...

    Wenn der User bestimmte Bedingungen nicht mehr hat - es geht hier um Software, die getestet wird - muss er die Datei(n) möglicherweise verwerfen und neue erstellen. Diese werden dann in einer 2. Func neu ausgewählt und natürlich dann auch in die o.g. Dateien gesichert, um beim nächsten Testlauf dann wieder verwendet werden zu können.

    Das Script läuft fehlerfrei, ich finde diese Lösung aber nicht so ideal...

    Habt Ihr vielleicht einen Gedankenanreger???


    Spoiler anzeigen
    [autoit]


    ; #FUNCTION# ====================================================================================================================
    ; Name...........: Start
    ; Description ...: Prestart without GUI
    ; Author ........: ****************************
    ; Remarks .......:
    ; ===============================================================================================================================
    Func Start()
    ;==========================================================
    ;====== call func ebiniread to readout ini ================
    ;==========================================================
    ;### Call func EbiniRead() to read out conditions to start the application

    [/autoit] [autoit][/autoit] [autoit]

    EbiniRead()

    [/autoit] [autoit][/autoit] [autoit]

    ;### lookup for files to read out Preconditions and Environments
    If FileExists(@ScriptDir & "\Settings\" & $box2 & ".txt") And FileExists(@ScriptDir & "\Settings\" & $box5 & ".txt") Then

    [/autoit] [autoit][/autoit] [autoit]

    ;### If both files are stored in Settings folder, show Messagebox to ask for take or destroy Preconditions.
    Local $pretest = MsgBox(36, "Preconditions", "To use saved preconditions from file " & @CRLF & "Press YES" & @CRLF & @CRLF & "To set new preconditions" & @CRLF & "press NO")

    [/autoit] [autoit][/autoit] [autoit]

    If $pretest = 7 Then
    FileDelete(@ScriptDir & '\Settings\' & $box2 & '.txt')
    Local $pretest1 = MsgBox(36, "Environments", "To use saved environments from file " & @CRLF & "Press YES" & @CRLF & @CRLF & "To set new environments" & @CRLF & "press NO")
    If $pretest1 = 7 Then
    FileDelete(@ScriptDir & '\Settings\' & $box5 & '.txt')
    $environments = "0"
    $read3 = FileRead(@ScriptDir & '\Settings\Reporter.txt')
    FileClose($read3)
    ;### If Environments have been destroyed by user, call func settings()
    Settings()
    Else
    ;### If old environments have to be used, call func Recover() to read out the old >
    ;### > environments and put them line for line into the 2nd textbox in $EditText2 in Main()
    Recover()
    EndIf
    ;### Read out Reporter.txt... this textfile includes the name, phone number and mail of the reporter >
    ;### > These informations have to be placed into the buildt $filename
    If FileExists(@ScriptDir & '\Settings\Reporter.txt') Then
    $read3 = FileRead(@ScriptDir & '\Settings\Reporter.txt')
    FileClose($read3)
    EndIf
    ;### call Func Settings()
    Settings()
    EndIf
    ;### Call _Main() if both textfiles are given and user wishes to take old files.
    Main()
    Else
    ;### First read Reporter.txt. Then call _Settings() to set preconditions and Environments, >
    ;### > if no earlier files are saved. >
    ;### > This window is shown every time the precondition.txt and >
    ;### > environment.txt is missing.
    If FileExists(@ScriptDir & '\Settings\Reporter.txt') Then
    $read3 = FileRead(@ScriptDir & '\Settings\Reporter.txt')
    FileClose($read3)
    EndIf
    Settings()
    EndIf
    EndFunc ;==>Start

    [/autoit]

    Für Ideen bin ich immer offen...

    Gruß

    Pitter

    Gruß
    Pitter

    Einmal editiert, zuletzt von Pitter (22. Februar 2012 um 20:58)