qazwsx Posted September 5, 2007 Share Posted September 5, 2007 I am trying to get the total number of something from an ini. The ini has many sections and each section has a key called number and a coresponding value. This is what i ahve so far to get the total. Func _updatecount () Local $count = 0 $names = IniReadSectionNames(@ScriptDir & "\winelist.ini") For $i = 1 To $names[0];For each array.. $count = $count + IniRead(@ScriptDir & "\winelist.ini", $names[$i], "Number", "") Next GUICtrlSetData($numberofbottles, "") GUICtrlSetState ($numberofbottles, $gui_show) GUICtrlSetData($numberofbottles, $count, "Error") EndFunc I think the problem is that Ini read is returning a string not a number. The label does not display anything it is not visible. If you need more code jst ask. Link to comment Share on other sites More sharing options...
Developers Jos Posted September 5, 2007 Developers Share Posted September 5, 2007 does this work for you ? Func _updatecount() Local $count = 0 $names = IniReadSectionNames(@ScriptDir & "\winelist.ini") For $i = 1 To $names[0];For each array.. $count += Number(IniRead(@ScriptDir & "\winelist.ini", $names[$i], "Number", "")) Next GUICtrlSetData($numberofbottles, $count) EndFunc ;==>_updatecount 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...
qazwsx Posted September 5, 2007 Author Share Posted September 5, 2007 (edited) yeh thx a lot. I dont really see how that is different tho lol. Edited September 5, 2007 by sccrstvn93 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