Jump to content

Array problems


Andre
 Share

Recommended Posts

Hi,

This is working :

Dim $ConfigFile_Array
_FileReadToArray($DefInstallDir & '\config\' &$ConfigFile, $ConfigFile_Array)
$FileHandle = FileOpen($DefInstallDir & '\config\' & $ConfigFile,2)
For $x = 1 to $ConfigFile_Array[0]
    FileWriteLine($FileHandle, $ConfigFile_Array[$x])
Next
FileClose($FileHandle)

This not :

Dim $ConfigFile_Array
_FileReadToArray($DefInstallDir & '\config\' &$ConfigFile, $ConfigFile_Array)
$FileHandle = FileOpen($DefInstallDir & '\config\' & $ConfigFile,2)
For $x = 1 to $ConfigFile_Array[0]
    $ConfigFile_Array[5] = 'test'
    FileWriteLine($FileHandle, $ConfigFile_Array[$x])
Next
FileClose($FileHandle)

Then only the text 'test' is written to the file.

Can't seem to find my error.

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

Hi,

Found the problem myself :lmao:

The file i used was an Unix Formatted file so no CRLF in it.

The _FileReadtoArray depends on them o:)

Andre

What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...