Ich schnalls nicht - Edit Box und Textdatei einlesen

  • Hallo leuts ich fummel mir hier ewig ein ab und kriegs einfach nicht gebacken.

    Ich habe ein Gui mit einer Editbox. Ich möchte gerne eine Textdatei in diese editbox einlesen und daran scheiterts.


    Wäre supi wenn mich jemand auf die richtige spur zurückbringen könnte...

  • Der witz ist mit list funktionierts wenn ichs aber auf edit umstell kommt nur die letzte line

    GUICtrlCreateLabel ("Log Notiz",5,135,200,20)
    $edi = GUICtrlCreateList ("",5,150,490,350)
    $file = FileOpen("logevt.txt", 0)

    ; Check if file opened for reading OK
    If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
    EndIf

    ; Read in lines of text until the EOF is reached
    While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop
    GUICtrlSetData ($edi , $line)
    Wend

    FileClose($file)

    GUISetState (@SW_SHOW)

  • Also falls nochmal jemand aufm schlauch stehen sollte ;)

    $edi = GUICtrlCreateedit ("",5,150,490,350)
    $file = FileOpen("logevt.txt", 0)

    ; Check if file opened for reading OK
    If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
    EndIf

    ; Read in lines of text until the EOF is reached
    $fr = FileRead ($file)
    GUICtrlSetData ($edi,$fr)

    FileClose($file)