Jump to content

Help with _FileReadToArray


Go to solution Solved by computergroove,

Recommended Posts

I have a file that changes values on occaision that looks like:

1;1
2;2
3;3
4;4
5;7
9;3

The file in called text.ini. I want to read these into a 2d array and I cannot find any examples of anyone doing it and I do not understand the function reference on the net. Can someone show me the correct syntax?

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

 

I have not used the function, but to me the writeup sounds like:

Local $aRead 

_FileWriteFromArray("c:\text.ini", $aRead , Default, Default, ";")
If Not @error then
_ArrayDisplay($aRead)
EndIf

I tried:

#include <Array.au3>
#Include <File.au3>

Local $aRead
Local $Path = @DesktopDir & "\text.ini"
_FileWriteFromArray($Path, $aRead , Default, Default, ";")
If Not @error then
    _ArrayDisplay($aRead)
EndIf

And it did nothing. No error either.

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Link to comment
Share on other sites

  • Solution

#include <Array.au3>
#Include <File.au3>

Local $aRead[][]=[[0],[0]]
Local $Path = @DesktopDir & "\temp.ini"
_FileReadToArray($Path, $aRead, 0, ";")
If Not @error then
    _ArrayDisplay($aRead)
EndIf

There was a typo and I got the above to work.

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

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...