Jump to content
Sign in to follow this  

Array INI files

Recommended Posts


This will display .ini files in the form of an array. UDF, please download file and don't just copy and paste. If you're worried about what the file COULD do, please right click on it after download and go to edit. There is nothing hidden in the file.


Func _ArrayINI (ByRef $File)
   Global $CountFile = 0
   $Information = @CR
   $Header = 0
   $ArrayQuery = ""

   FileOpen ($File, 0)

      $CountFile = $CountFile + 1
      $CountLine = FileReadLine ($File, $CountFile)
   Until @Error = -1

   For $Count1 = 1 To ($CountFile - 1)
      $Read = FileReadLine ($File, $Count1)
      $Information = $Information & $Read & @CR 

   $StripSpace = StringStripWS ($Information, 7)
   $Info = StringSplit ($StripSpace, "=" & @CR)

   For $Count = 0 To UBound ($Info) - 1
   $ArrayQuery = $ArrayQuery & "[" & $Count & "] = " & _
   $Info[$Count] & @CR
   If IsArray ($Info) = 0 Then
      MsgBox (4096, "Error", "Array = Not Valid")
      MsgBox (4096, "", $ArrayQuery)

How to use the UDF:

#Include <_ArrayINI.au3>

$File = "Path\Name.Extention"
_ArrayINI ($File)



Edited by Frozenyam

"... and the Lord said to John, "Come forth and ye shall receive eternal life," but instead John came fifth and won a toaster."

Share this post

Link to post
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
Sign in to follow this