Jump to content

IniReadSection to an already existing array


Recommended Posts

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.

Link to comment
Share on other sites

  • Moderators

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

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.

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