Array 0 aktualisieren ?

  • Hallo,

    Ich lese eine test.txt in array ein und dabei wird ja auch ausgegeben wieviel einträge es gibt.
    soweit so gut :D

    nun kommt aber ein
    _ArrayAdd
    aber das array wird nicht mehr aktualisiert was halt in 0 steht

    ich weiss mit Ubound - 1 bekomme ich auch den wert
    aber geht es nicht ohne ?


    Spoiler anzeigen


    #include <Array.au3>
    #include <File.au3>
    Dim $testArray
    If Not _FileReadToArray("test.txt", $testArray) Then
    ;wenn beim einlesen ein fehler auftaucht
    MsgBox(4096, "Error", " Error reading log to Array error:" & @error)
    Exit
    EndIf

    _ArrayDisplay( $testArray, "Whole array" )
    _ArrayAdd( $testArray,"New")
    _ArrayDisplay( $testArray, "Updated Array" )
    Exit

  • Hi,

    [autoit]

    #include <Array.au3>
    #include <File.au3>
    Dim $testArray
    If Not _FileReadToArray("test.txt", $testArray) Then
    ;wenn beim einlesen ein fehler auftaucht
    MsgBox(4096, "Error", " Error reading log to Array error:" & @error)
    Exit
    EndIf

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

    _ArrayDisplay( $testArray, "Whole array" )
    _ArrayAdd( $testArray,"New")
    $testArray[0] += 1
    _ArrayDisplay( $testArray, "Updated Array" )
    Exit

    [/autoit]

    So sollte es gehen

    mfg