Jump to content

Recommended Posts

Posted

I'm working on a blog system in Autoit, so i decided INIFile would be the easiest way to go. After many attempts, i decided to take a stab at using INIReadSelection. If you've seen some of my other topics, you would have seen 99% of them in support are about array problems. Se here's one more for ya :).

I got this code:

IniWrite($sINIDir, "posts", _Post("postname"), _Post("postext"))
oÝ÷ Ùhbr¬«^®·u¼­+¡×¡z·ºÚ"µÍQÜ ÌÍÚHHHÈ ÌÍØRSTXYÌVÌBBQÜ   ÌÍØHHHÈ ÌÍØRSTXYÌWVÌBBBQXÚÊ  ÌÍØRSTXYÉÌÍÚWVÌH    [È ][ÝÉØÝÉ][ÝÊBBBQXÚÊ ÌÍØRSTXYÉÌÍØWVÉÌÍÚWH [È ][ÝÉØÝÉØÝÉ][ÝÊBBS^S^

Is the formatting in my INIReadSection thing wrong?

Please note, that $aINIRead is declared earlier in the script. It just equals INIReadSection("blogposts.ini", "posts")

I didn't include the rest of the script because i think it is a problem with my INIReadSection array format.

Posted

Why are you looping from 1 to the first key in the section? $aINIRead[1][0] is the 'key' in the following example:

[section]

key=value

What are you reading from the INI file that two loops helps you to parse? Shouldn't it just be

For $i = 1 To $aINIRead[0][0]
    Echo($aINIRead[$i][0] & "<br>")
    Echo($aINIRead[$i][1] & "<br><br>")
Next
?
Posted

I still say take some time and learn SQLite.

Posted

Like kryptonite to Superman......I get how you are struggling with arrays. If you look in my sig, you will find a link to a paper by Uten on how to use arrays in AutoIt.

5 minutes into reading that i already learned something.

I have another question though.

Is it possible to re-order the entries in the INI files to list the newest one first and not last?

Posted

I'm working on a blog system in Autoit, so i decided INIFile would be the easiest way to go. After many attempts, i decided to take a stab at using INIReadSelection.

Now, why does this sound like a bad design decision?

5 minutes into reading that i already learned something.

Thank you. It's good to know I did not waste all of that time (including @katrijn and @JdeB's)..:)

I have another question though.

Is it possible to re-order the entries in the INI files to list the newest one first and not last?

Uhm, well now we probably know..:D

Take the sqlite advice. Or just use flat files in a directory. It will take you a few days to get up to speed with sqlite but I promise, in this case, it will be worth it. At least if you intend to distribute your solution.

Happy scripting....

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...