BananaFredSoft Posted August 7, 2007 Share Posted August 7, 2007 (edited) For some reason when I use the following script, it makes a section for each key in a .ini. Any ideas? IniWrite(@ScriptDir & "\Songs" & $num & ".data", $fullpaths[$inum], "Year", GUICtrlRead($inpYear)) IniWrite(@ScmriptDir & "\Songs" & $num & ".data", $fullpaths[$inum], "Genre", GUICtrlRead($inpGenre)) IniWrite(@ScriptDir & "\Songs" & $num & ".data", $fullpaths[$inum], "Album Title", GUICtrlRead($inpAlbumTitle)) IniWrite(@ScriptDir & "\Songs" & $num & ".data", $fullpaths[$inum], "Song Name", GUICtrlRead($inpSongName)) IniWrite(@ScriptDir & "\Songs" & $num & ".data", $fullpaths[$inum], "Group Name", GUICtrlRead($inpGroupName)) IniWrite(@ScriptDir & "\Songs" & $num & ".data", "Other", "Number", IniRead(@ScriptDir & "\Songs" & $num & ".data", "Other", "Number", 0) + 1) Edited August 7, 2007 by BananaFredSoft -ColinSite:www.bananafredsoft.comStuff:Simple Text Editor - MediaPlayer - Animator - BananaDB - BananaNotes - Chatta - Filesearch - Excuse GeneratorMy YouTube channel:http://www.youtube.com/user/colipat Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 7, 2007 Moderators Share Posted August 7, 2007 For some reason when I use the following script, it makes a section for each key in a .ini. Any ideas? IniWrite(@ScriptDir & "\Songs" & $num & ".data", $fullpaths[$inum], "Year", GUICtrlRead($inpYear)) IniWrite(@ScmriptDir & "\Songs" & $num & ".data", $fullpaths[$inum], "Genre", GUICtrlRead($inpGenre)) IniWrite(@ScriptDir & "\Songs" & $num & ".data", $fullpaths[$inum], "Album Title", GUICtrlRead($inpAlbumTitle)) IniWrite(@ScriptDir & "\Songs" & $num & ".data", $fullpaths[$inum], "Song Name", GUICtrlRead($inpSongName)) IniWrite(@ScriptDir & "\Songs" & $num & ".data", $fullpaths[$inum], "Group Name", GUICtrlRead($inpGroupName)) IniWrite(@ScriptDir & "\Songs" & $num & ".data", "Other", "Number", IniRead(@ScriptDir & "\Songs" & $num & ".data", "Other", "Number", 0) + 1)Do you have a working example (we have no idea what the sections are even supposed to be!)? Also your last IniWrite there... you have it adding a string to an integer 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 More sharing options...
WolfWorld Posted August 7, 2007 Share Posted August 7, 2007 What Is The Error Message Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
BananaFredSoft Posted August 7, 2007 Author Share Posted August 7, 2007 (edited) athiwatc: There is no error message. SmOke_N: Script posted. Edit: Attachment removed. Edited August 7, 2007 by BananaFredSoft -ColinSite:www.bananafredsoft.comStuff:Simple Text Editor - MediaPlayer - Animator - BananaDB - BananaNotes - Chatta - Filesearch - Excuse GeneratorMy YouTube channel:http://www.youtube.com/user/colipat Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 7, 2007 Moderators Share Posted August 7, 2007 athiwatc: There is no error message. SmOke_N: Script posted.I didn't mean post a 1200+ line script for us to debug... just write a small reenactment script that does what you are saying this script does... If you can't, then I would probably re-check my $fullpaths[$inum] with a message box before I started my IniWrite's... you'd probably find that they aren't the values you think they are... 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 More sharing options...
BananaFredSoft Posted August 7, 2007 Author Share Posted August 7, 2007 I didn't mean post a 1200+ line script for us to debug... just write a small reenactment script that does what you are saying this script does... If you can't, then I would probably re-check my $fullpaths[$inum] with a message box before I started my IniWrite's... you'd probably find that they aren't the values you think they are... Sorry. Actually, for some reason, it only does this with a certain folder (the section names are file paths). I think this is because the path is quite long. Here is a demo: Long path: $num = "test" IniWrite(@ScriptDir & "\Songs" & $num & ".data", "C:\Documents and Settings\Colin\My Documents\My Music\Good Charlotte\The Chronicles of Life and Death [Death Version]1 Once Upon a Time- The Battle of Life and Death.mp3", "Year", "2007") IniWrite(@ScriptDir & "\Songs" & $num & ".data", "C:\Documents and Settings\Colin\My Documents\My Music\Good Charlotte\The Chronicles of Life and Death [Death Version]1 Once Upon a Time- The Battle of Life and Death.mp3", "Genre", "music") IniWrite(@ScriptDir & "\Songs" & $num & ".data", "C:\Documents and Settings\Colin\My Documents\My Music\Good Charlotte\The Chronicles of Life and Death [Death Version]1 Once Upon a Time- The Battle of Life and Death.mp3", "Album Title", "test title") IniWrite(@ScriptDir & "\Songs" & $num & ".data", "C:\Documents and Settings\Colin\My Documents\My Music\Good Charlotte\The Chronicles of Life and Death [Death Version]1 Once Upon a Time- The Battle of Life and Death.mp3", "Song Name", "test song") IniWrite(@ScriptDir & "\Songs" & $num & ".data", "C:\Documents and Settings\Colin\My Documents\My Music\Good Charlotte\The Chronicles of Life and Death [Death Version]1 Once Upon a Time- The Battle of Life and Death.mp3", "Group Name", "test group")oÝ÷ Ù(h®ÚZ¶®¶s`b33c¶çVÒÒgV÷C·FW7BgV÷C° æw&FR67&DF"fײgV÷C²b3#µ6öæw2gV÷C²fײb33c¶çVÒfײgV÷C²æFFgV÷C²ÂgV÷C·FW7BgV÷C²ÂgV÷CµV"gV÷C²ÂgV÷C³#rgV÷C² æw&FR67&DF"fײgV÷C²b3#µ6öæw2gV÷C²fײb33c¶çVÒfײgV÷C²æFFgV÷C²ÂgV÷C·FW7BgV÷C²ÂgV÷C´vVç&RgV÷C²ÂgV÷C¶×W62gV÷C² æw&FR67&DF"fײgV÷C²b3#µ6öæw2gV÷C²fײb33c¶çVÒfײgV÷C²æFFgV÷C²ÂgV÷C·FW7BgV÷C²ÂgV÷C´Æ'VÒFFÆRgV÷C²ÂgV÷C·FW7BFFÆRgV÷C² æw&FR67&DF"fײgV÷C²b3#µ6öæw2gV÷C²fײb33c¶çVÒfײgV÷C²æFFgV÷C²ÂgV÷C·FW7BgV÷C²ÂgV÷Cµ6öæræÖRgV÷C²ÂgV÷C·FW7B6öærgV÷C² æw&FR67&DF"fײgV÷C²b3#µ6öæw2gV÷C²fײb33c¶çVÒfײgV÷C²æFFgV÷C²ÂgV÷C·FW7BgV÷C²ÂgV÷C´w&÷WæÖRgV÷C²ÂgV÷C·FW7Bw&÷WgV÷C² For me the error only occurs with the long path. -ColinSite:www.bananafredsoft.comStuff:Simple Text Editor - MediaPlayer - Animator - BananaDB - BananaNotes - Chatta - Filesearch - Excuse GeneratorMy YouTube channel:http://www.youtube.com/user/colipat Link to comment Share on other sites More sharing options...
Generator Posted August 7, 2007 Share Posted August 7, 2007 One thing i noticed is ini won't write if the string is too long, maybe i did it wrong but it happened to me too. Link to comment Share on other sites More sharing options...
Developers Jos Posted August 7, 2007 Developers Share Posted August 7, 2007 (edited) MMM... You should not use Square brackets in the Section name I think ... This also fails: $num = "test" $secname = "C:\Do[cu]m" IniWrite(@ScriptDir & "\Songs" & $num & ".data", $secname, "Year", "2007") IniWrite(@ScriptDir & "\Songs" & $num & ".data", $secname, "Genre", "music") Edited August 7, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
BananaFredSoft Posted August 8, 2007 Author Share Posted August 8, 2007 MMM... You should not use Square brackets in the Section name I think ...So that's the problem. Thanks! -ColinSite:www.bananafredsoft.comStuff:Simple Text Editor - MediaPlayer - Animator - BananaDB - BananaNotes - Chatta - Filesearch - Excuse GeneratorMy YouTube channel:http://www.youtube.com/user/colipat 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