Starstar Posted May 15, 2015 Share Posted May 15, 2015 (edited) For $i = 1 To 1000 $List = IniReadSection(@DesktopDir&"\AllsaleAmount.ini","DATA") $Total = $List[1][1] ++ $List[1][$i] Next MsgBox(0,"total",$Total) I am trying like this but i got error( Array variable has incorrect number of subscripts or subscript dimension range exceeded.:$Total = $List[1][1] ++ $List[1][$i]) in console. Edited May 15, 2015 by Starstar Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 15, 2015 Moderators Share Posted May 15, 2015 Can you please provide an example of what info out of the INI you're trying to get? Rather than the $i = 1 To 1000 route, why not use the 2d array returned from IniReadSection directly? $List[0][0] will tell you how many elements you have, And it is always in a key/value pair - [$i][0] = Key and [$i][1] = Value. If you need to stick with this method, change your $List[1][$i] call around; the way you have it written, you would be looking for $List[1][999] at some point, which isn't going to exist of course. Starstar 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 15, 2015 Moderators Share Posted May 15, 2015 Starstar,From the Help file for IniReadSection:The number of elements returned will be in $aArray[0][0]M23 Starstar 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 15, 2015 Moderators Share Posted May 15, 2015 Ha! 6 years and I finally beat you lol Starstar 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 15, 2015 Moderators Share Posted May 15, 2015 JLogan3o13,My most hearty congratulations on your achievement.M23 Starstar 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Starstar Posted May 15, 2015 Author Share Posted May 15, 2015 Melba23i want to get total value amount? not how many keys are written. Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 15, 2015 Moderators Share Posted May 15, 2015 Starstar,Assuming all the elements are numeric, you can do it like this:$Total_Keys = 0 $Total_Values = 0 $List = IniReadSection(@DesktopDir & "\AllsaleAmount.ini", "DATA") For $i = 1 To $List[0][0] $Total_Keys += $List[$i][0] $Total_Values += $List[$i][1] Next MsgBox(0, "total", $Total_Keys & @CRLF & $Total_Values)M23 Starstar 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Starstar Posted May 15, 2015 Author Share Posted May 15, 2015 Starstar,Assuming all the elements are numeric, you can do it like this:$Total_Keys = 0 $Total_Values = 0 $List = IniReadSection(@DesktopDir & "\AllsaleAmount.ini", "DATA") For $i = 1 To $List[0][0] $Total_Keys += $List[$i][0] $Total_Values += $List[$i][1] Next MsgBox(0, "total", $Total_Keys & @CRLF & $Total_Values)M23Thanks to all and special thanks to Melba23 problem solved......... Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." 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