Sign in to follow this  
Followers 0
Xenthalon

IniReadSection to an already existing array

3 posts in this topic

Hi,

I want to create a small application that dynamically reads a whole .ini file. The problem I run into is that I first read the section names to an array and then read the section content in that array.

$iniSections = IniReadSectionNames("traytip.ini")
Dim $iniContent[$iniSections[0] + 1]

For $i = 1 To $iniSections[0]
    $iniContent[$i] = IniReadSection("traytip.ini",$iniSections[$i])
    If @error = 1 Then MsgBox(0,"nooo","error arr")
Next

MsgBox(0,"",$iniContent[1][0][0])

@error flag is not set, so that part is fine. I was under the impression that IniReadSection automatically appends the two dimensions the the variable provided, but somehow i always get dimension ranges exceeded.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I don't know what you mean by append, if you mean that [x] (A declared single dimensional array) becomes [x][x][x] (a declared 3 dimensional array), the answer is... No. You'll have to make your own function to create the new 3 dimensional array.... If I am not mistaken, I've posted something to do this in the scripts and scraps before... I'll have a look.

Edit:

Yes, It stores the Section, Key, and Value.

http://www.autoitscript.com/forum/index.ph...c=30857&hl=

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Ok, thanks for your help.

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  
Followers 0