gcue Posted April 2, 2009 Share Posted April 2, 2009 hello. brain fart.. what am i doing wrong? trying to count the number of computer assets found in an INI (so it will count the number of entries under section names that have "_ASSETS" in the sectionname $acount = 0 $sections = IniReadSectionNames($aINI) For $x = 1 To $sections[0] $suffix = StringRight($sections[$x], 7) If $suffix = "_ASSETS" Then $asset = IniReadSection($aINI, $sections[$x]) For $i = 1 To $asset[0][0] $asset_total_count = $acount + $asset[0][0] Next EndIf Next MsgBox(0, "", $asset_total_count) Link to comment Share on other sites More sharing options...
DaRam Posted April 2, 2009 Share Posted April 2, 2009 Well the brain fart extended to not including a sample INI/contents and what the count should be and what you are getting. Link to comment Share on other sites More sharing options...
Authenticity Posted April 2, 2009 Share Posted April 2, 2009 (edited) StringRight return ASSETS] and not _ASSETS. Maybe that is the problem?Edit: Let me check... I may be wrong.Edit2: lol. Yes, I'm wrong. ;]$asset_total_count = 0 $sections = IniReadSectionNames($aINI) For $x = 1 To $sections[0] $suffix = StringRight($sections[$x], 7) If $suffix = "_ASSETS" Then ConsoleWrite($sections[$x] & @LF) $asset = IniReadSection($aINI, $sections[$x]) For $i = 1 To $asset[0][0] $asset_total_count += 1 Next EndIf Next MsgBox(0, "", $asset_total_count) Edited April 2, 2009 by Authenticity Link to comment Share on other sites More sharing options...
gcue Posted April 2, 2009 Author Share Posted April 2, 2009 perfect!!! thanks mate 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