Frozenyam Posted August 12, 2005 Share Posted August 12, 2005 (edited) 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. #Include-Once Func _ArrayINI (ByRef $File) Global $CountFile = 0 $Information = @CR $Header = 0 $ArrayQuery = "" FileOpen ($File, 0) Do $CountFile = $CountFile + 1 $CountLine = FileReadLine ($File, $CountFile) Until @Error = -1 For $Count1 = 1 To ($CountFile - 1) $Read = FileReadLine ($File, $Count1) $Information = $Information & $Read & @CR Next $StripSpace = StringStripWS ($Information, 7) $Info = StringSplit ($StripSpace, "=" & @CR) For $Count = 0 To UBound ($Info) - 1 $ArrayQuery = $ArrayQuery & "[" & $Count & "] = " & _ $Info[$Count] & @CR Next If IsArray ($Info) = 0 Then MsgBox (4096, "Error", "Array = Not Valid") Else MsgBox (4096, "", $ArrayQuery) EndIf EndFunc How to use the UDF: #Include <_ArrayINI.au3> $File = "Path\Name.Extention" _ArrayINI ($File) _ArrayINI.au3 Edited August 12, 2005 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." Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now