Zeichen zusammensetzen

  • While 1
    $line2 = FileReadLine($file)
    (xxxxxxxxxxxx)


    dim $linecombo = $line2 & "|"
    dim $linvar = $linecombo
    dim $linecombo2 = $linecombo2 & $linvar
    MsgBox(4096,"Warnung" , $linecombo2 )


    If @error = -1 Then ExitLoop
    Wend

    Was muss ich bei x einfügen um die kommenden Zeilen aneinander zu reihen?

  • Hier mal ein Script wo ein String geteilt und auch wieder zusammen gefügt wird.

    Einfach bischen mit rum "spielen" und ggf. anpassen.

    Spoiler anzeigen
    [autoit]


    #include<Array.au3>
    $fFile = "\\server\share\order1\dummy.txt"

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

    $4_array = StringSplit($fFile, '', 1) ; hiermit splittest Du die Datei
    MSgBox(0,"", Ubound($4_array) - 1) ; ist das gleiche wie: MsgBox(0,"",$4_array[0])

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

    MsgBox(0, "Test", $4_array[3]&$4_array[4]&$4_array[5]&$4_array[6]&$4_array[7]&$4_array[8]&" - "&$4_array[10]&$4_array[11]&$4_array[12]&$4_array[13]&$4_array[14]&" - "&$4_array[16]&$4_array[17]&$4_array[18]&$4_array[19]&$4_array[20]&$4_array[21])
    ;MsgBox(0, "Test", $4_array[3] bis $4_array[8]&" - "&$4_array[10] bis $4_array[14]&" - "&$4_array[16] bis $4_array[21])

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

    ;_ArrayToString(Const ByRef $avArray[, $sDelim = "|"[, $iStart = 0[, $iEnd = 0]]])
    MsgBox(0, "_ArrayToString() erhält von $avArray die Items 1 bis 7", _ArrayToString($4_array, '', 3, 8) & " - " & _ArrayToString($4_array, '', 10, 14))

    [/autoit]

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    OuBVU5ebLhHu5QvlnAyQB4A7SzBrvWulwL7RLl2BdH5tI6sIYspeMKeXMSXl

  • Hey, warum machst du es nicht einfach so:

    [autoit]

    StringReplace(FileRead($file), @CRLF, "|")

    [/autoit]


    Ist kürzer und einfacher!

    Sonst:

    [autoit]


    $AllLines = ""
    While 1
    $line2 = FileReadLine($file)
    If @error = -1 Then
    StringTrimRight($AllLines, 1)
    ExitLoop
    EndIf
    $AllLines &= $line2 &"|"
    WEnd

    [/autoit]

    Jaja, Moo does the Cow!

  • Spoiler anzeigen


    $Combo1 = GUICtrlCreateCombo("", 70, 160, 300, 22)
    If FileExists(@ScriptDir & '\SkriptPathangaben.txt') Then
    $file = FileOpen ( "SkriptPathangaben.txt", 0 )
    If $file = -1 Then
    MsgBox(0, "Error", "Kann Datei nicht Öffnen!")
    Exit
    EndIf
    $line = FileReadLine( "SkriptPathangaben.txt" , -1 )
    $AllLines = ""
    While 1
    $line2 = FileReadLine($file)
    If @error = -1 Then
    StringTrimRight($AllLines, 1)
    ExitLoop
    EndIf
    $AllLines &= $line2 &"|"
    $AllLines2 = "" &
    WEnd
    Else
    MsgBox(4096,"Warnung" , "SkriptPathangaben.txt does NOT exists")
    EndIf
    $Combo1 = GUICtrlSetData(-1, $AllLines )


    Diese Letzte Zeile macht mir Probleme.
    $Combo1 = GUICtrlSetData(-1, $AllLines )

    Sieht das so aus geht es,
    $Combo1 = GUICtrlSetData(-1, "Alte versionen|C\...\|C\...\1|C\...\12|C\...\tgf|C\...\hnf|Done" , "Alte versionen" )

    Doch kann ein neuer Phat angelegt werden, die zeile verlängert sich.
    Nur will ich es Kürzer schreiben und Mobiler.

    Der Inhalt von $AllLines ist momentan:
    Alte Versionen|C\...\|C\...\1|C\...\12|C\...\tgf|C\...\hnf|Done

    Nur die GänzeFüßschen fehlen.
    Wie geht es? """ geht nicht.

    Einmal editiert, zuletzt von Skar (26. August 2009 um 16:33)

  • Nächste Frage:


    Kenzeichnung <-----------------------

    Spoiler anzeigen


    #Region ### START Koda GUI section ### Form=C:\Dokumente und Einstellungen\busch.GAIAAKKU\Desktop\JagtSkript.exe\FormSkriptSpeicherort.kxf
    $Form2 = GUICreate("Skriptspeicherort", 402, 201, 203, 193)
    GUISetCursor (2)
    GUISetFont(8, 400, 0, "Arial")
    GUISetBkColor(0x3D95FF)
    $Label2 = GUICtrlCreateLabel("Hir kommt der Path zu den neuen Skript Quellcode rein.", 8, 16, 383, 20)
    GUICtrlSetFont(-1, 10, 800, 4, "MS Sans Serif")
    $Label1 = GUICtrlCreateLabel("Path:", 8, 60, 56, 28)
    GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")
    $Input1 = GUICtrlCreateInput("", 70, 60, 300, 22) ;<-----------------------
    GUICtrlSetCursor (-1, 5)
    $Button1 = GUICtrlCreateButton("Speichern", 262, 102, 105, 30)
    GUICtrlSetFont(-1, 8, 800, 4, "Arial")
    GUICtrlSetCursor (-1, 0)
    $Label3 = GUICtrlCreateLabel("zB. c:\....\...\(Ver.1.0)J.euo", 72, 88, 132, 18)
    $Combo1 = GUICtrlCreateCombo("", 70, 160, 300, 22) ;<-----------------------

    If FileExists(@ScriptDir & '\SkriptPathangaben.txt') Then
    $file = FileOpen ( "SkriptPathangaben.txt", 0 )
    If $file = -1 Then
    MsgBox(0, "Error", "Kann Datei nicht Öffnen!")
    Exit
    EndIf
    $AllLines = ""
    While 1
    $line = FileReadLine($file)
    If @error = -1 Then
    StringTrimRight($AllLines, 1)
    ExitLoop
    EndIf
    $AllLines &= $line &"|"
    Dim $AllLines2 = $AllLines
    WEnd
    Else
    MsgBox(4096,"Warnung" , "SkriptPathangaben.txt does NOT exists")
    EndIf
    $Combo1 = GUICtrlSetData(-1, $AllLines2 ) ;<-----------------------
    $Label4 = GUICtrlCreateLabel("Alte Versionen einfach Auswählen.", 70, 136, 76, 22)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Combo1 <-----------------------

    (xxxxxxxxx) <-----------------------Dort ist mein Problem. Inhalt der Combo soll in die Input box copiert werden
    $Path1 = GuiCtrlRead($Combo1)
    GUICtrlSetData ($Input1, $Path1)


    Case $Button1

    $Path = GuiCtrlRead($Input1)
    If FileExists(@ScriptDir & '\SkriptPathangaben.txt') Then
    $file = FileOpen ( "SkriptPathangaben.txt", 1 )
    If $file = -1 Then
    MsgBox(0, "Error", "Kann Datei nicht Öffnen!")
    Exit
    EndIf
    FileWrite($file, @CRLF)
    FileWrite($file, $Path )
    FileClose($file)
    Else
    MsgBox(4096,"Warnung" , "SkriptPathangaben.txt does NOT exists")
    EndIf


    EndSwitch
    WEnd

    Wie gibt man den ausgewählten wehrt einer Combobox sofort an die Input box weiter?

    Hat jemand einen Hinweiß?

    2 Mal editiert, zuletzt von Skar (27. August 2009 um 11:06)