Valuater Posted September 21, 2005 Share Posted September 21, 2005 i have been at this for hours... just can't seem to get it i would like this Test.ini [Section] 4a=5 2=1 6=end 3=3 2a=2 4=4 5=6 1=begin to look like this Test.ini [Section] 1=begin 2=1 3=2 4=3 5=4 6=5 7=6 8=end this is my function Func Set_Slip() $avArray = IniReadSection("Test.ini", "Section") If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") EndIf $var = $avArray[0][0] _ArraySort($avArray[0][0],0,1) IniDelete("Test.ini", "Section") For $i = 1 To $var IniWrite("Test.ini","Section", $avArray[$i][0], $avArray[$i][1]) Next Run("notepad.exe Test.ini") EndFunc the array sort doesn't seem to be doing its job... maybe it's me another set of eyes might see the prob right away... thanks 8) Link to comment Share on other sites More sharing options...
Dickb Posted September 21, 2005 Share Posted September 21, 2005 This should do the trick. See comments in code. Dick #include <Array.au3> Set_Slip() Exit Func Set_Slip() $avArray = IniReadSection("Test.ini", "Section") If @error Then MsgBox(4096, "", "Error occured, probably no INI file.") EndIf RunWait("notepad.exe Test.ini") $var = $avArray[0][0] _ArraySort($avArray, 0, 1, 0, 2) ; Only array name needed and ; need to tel sort that it's a 2 demenional array IniDelete("Test.ini", "Section") For $i = 1 To $var IniWrite("Test.ini", "Section", $avArray[$i][0], $avArray[$i][1]) Next Run("notepad.exe Test.ini") EndFunc ;==>Set_Slip Link to comment Share on other sites More sharing options...
Valuater Posted September 21, 2005 Author Share Posted September 21, 2005 Got it thanks... Dickb 8) Almost.... thanks for the help on the arraysort() had to change this line also IniWrite($Loc_work_file,$Sec_day, $i, $avArray[$i][1]) 8) 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