Demon777 Posted November 2, 2008 Share Posted November 2, 2008 Hello everyone. I have 1 problem.. I want to make script that read ini file and read all ini Selection Names in it. After that my script should read this selection names and set all key's in this selection names into ListView Control. Thats what i have : Func _Check() InetGet($Server, $InI) If @error Then GUICtrlSetData($Information, "Error!") $Var = IniReadSectionNames($InI) For $i = 1 To $Var[0] $Var2 = IniReadSection($Var, $Var[$i]) For $a = 1 To $Var2[0][0] Local $link = IniRead($Var, $Var2, "onlinelink", "") Local $name = IniRead($Var, $Var2, "onlinename", "") Local $status = IniRead($Var, $Var2, "status", "") GUICtrlSetData($UpdateList_0, $name & "|" & $link & "|" & $status) Next Next EndFunc ListView code : $UpdateList = GUICtrlCreateListView("File|Link|Status", 8, 32, 410, 142, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_HEADERDRAGDROP)) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 80) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 240) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 86) $UpdateList_0 = GUICtrlCreateListViewItem("File.txt|localhost/file.txt|New Version", $UpdateList) $UpdateList_1 = GUICtrlCreateListViewItem("About.txt|localhost/about.txt|New Version", $UpdateList) $InI = @Tempdir & "\test.ini" But it dont work. Hope for fast answer. (Sry for bad English) Link to comment Share on other sites More sharing options...
furrycow Posted November 2, 2008 Share Posted November 2, 2008 Hello everyone. I have 1 problem.. I want to make script that read ini file and read all ini Selection Names in it. After that my script should read this selection names and set all key's in this selection names into ListView Control. Thats what i have : Func _Check() InetGet($Server, $InI) If @error Then GUICtrlSetData($Information, "Error!") $Var = IniReadSectionNames($InI) For $i = 1 To $Var[0] $Var2 = IniReadSection($Var, $Var[$i]) For $a = 1 To $Var2[0][0] Local $link = IniRead($Var, $Var2, "onlinelink", "") Local $name = IniRead($Var, $Var2, "onlinename", "") Local $status = IniRead($Var, $Var2, "status", "") .... I dont really know much about arrays, but shouldnt $var and $var2 in... Local $link = IniRead($Var, $Var2, "onlinelink", "") Local $name = IniRead($Var, $Var2, "onlinename", "") Local $status = IniRead($Var, $Var2, "status", "") be arrays, such as $var[n][1] or what not.... ...also, the first part of iniread() is the filename --> iniread("filename",.....) Instant Lockerz Invite - www.instantlockerzinvite.co.uk Link to comment Share on other sites More sharing options...
Valuater Posted November 2, 2008 Share Posted November 2, 2008 (edited) **** NOT TESTED Func _Check() InetGet($Server, $InI) If @error Then Return GUICtrlSetData($Information, "Error!") $Var = IniReadSectionNames($InI) For $i = 1 To $Var[0] Local $link = IniRead($InI, $Var[$i], "onlinelink", "") Local $name = IniRead($InI, $Var[$i], "onlinename", "") Local $status = IniRead($InI, $Var[$i], "status", "") GUICtrlSetData($UpdateList_0, $name & "|" & $link & "|" & $status) ConsoleWrite($name & "|" & $link & "|" & $status & @CRLF) ; for testing Next EndFunc ;==>_Check 8) Edited November 2, 2008 by Valuater Link to comment Share on other sites More sharing options...
Demon777 Posted November 2, 2008 Author Share Posted November 2, 2008 Thank you mate !!! You the best ! ^-^ It works =D Link to comment Share on other sites More sharing options...
Valuater Posted November 2, 2008 Share Posted November 2, 2008 Thank you mate !!! You the best ! ^-^It works =DWelcome!I could see your effort even though you were completely lost. Thats why we help people who try...here is a link to something I did with all the code there too!http://www.autoitscript.com/forum/index.ph...st&p=282067Good Luck8) Link to comment Share on other sites More sharing options...
Demon777 Posted November 2, 2008 Author Share Posted November 2, 2008 (edited) I still have 1 prob =( I have ini file. This ini file has 2 Selections with Key's. Exp : [selection1] Key1 = "value" Key2 = "value" Key3 = "value" [selection2] Key1 = "value" Key2 = "value" Key3 = "value" So now if i add new Selection with Keys, my script should read it and show it in ListView.. Valuater your example works but it read only 1 Selection from InI File..And it shows only 1 in ListView Any way how i can show all Selections and keys in ListView ? Thanks =) Edited November 2, 2008 by Demon777 Link to comment Share on other sites More sharing options...
Valuater Posted November 2, 2008 Share Posted November 2, 2008 (edited) Try this ( listview ) Func _Check() InetGet($Server, $InI) If @error Then Return GUICtrlSetData($Information, "Error!") $Var = IniReadSectionNames($InI) For $i = 1 To $Var[0] Local $link = IniRead($InI, $Var[$i], "onlinelink", "") Local $name = IniRead($InI, $Var[$i], "onlinename", "") Local $status = IniRead($InI, $Var[$i], "status", "") GUICtrlCreateListViewItem($name & "|" & $link & "|" & $status, $UpdateList) ConsoleWrite($name & "|" & $link & "|" & $status & @CRLF) ; for testing Next EndFunc ;==>_Check 8) Edited November 2, 2008 by Valuater 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