NELyon Posted January 13, 2007 Posted January 13, 2007 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.
Outshynd Posted January 13, 2007 Posted January 13, 2007 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?
NELyon Posted January 13, 2007 Author Posted January 13, 2007 Ugh... that worked. Like i said, me+INIReadSection = BIG NONO Thanks
McGod Posted January 13, 2007 Posted January 13, 2007 I still say take some time and learn SQLite. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
Outshynd Posted January 13, 2007 Posted January 13, 2007 I was basically just stumbling around in the dark, but glad I could help
Bert Posted January 13, 2007 Posted January 13, 2007 (edited) Ugh... that worked. Like i said, me+INIReadSection = BIG NONO ThanksLike 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. Edited January 13, 2007 by Volly The Vollatran project My blog: http://www.vollysinterestingshit.com/
NELyon Posted January 13, 2007 Author Posted January 13, 2007 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?
Uten Posted January 13, 2007 Posted January 13, 2007 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..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.... Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
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