New topic: Listbox help needed
<http://forums.realsoftware.com/viewtopic.php?t=45790> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message RicSum Post subject: Listbox help neededPosted: Fri Nov 02, 2012 6:57 am Joined: Fri Jun 05, 2009 4:54 pm Posts: 369 Location: London, England Hi, I have a Listbox with 6 columns (column 5 has the heading "Resolved", and the user can type "yes" or "no" into it). Column 4 has the heading "Surname". The code below searches all the rows of the listbox and looks for repetition of the same surname. If the same surname is found 3 or more times - a MsgBox displays. What I need help to do, is to have the MsgBox exclude entries which have the word YES in the resolved column. In other words - only entries with the same surname AND which do not have the word YES in the resolved column. dim row, count as integer dim name, names() as string // first accumulate all the unique names for row = 0 to lb_trends.ListCount-1 name = lb_trends.Cell(row, 4) if names.IndexOf(name)< 0 then names.append(name) next // now report the ones that appear more than 2 times for row = 0 to Ubound(names) count = CountName(names(row))+1 if count >= 3 then msgbox "Analysis has discovered that the name " + names(row) + ", has been found " + str(count) + " times." end next Hope that made sense, as it was a bit hard to explain. Thank you all in advance. _________________ RealStudio Professional Edition 2011 Release 4 Developing on OS X 10.8 (Mountain Lion) Deploying on Windows XP / 7 Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml rbforumnotifier@monkeybreadsoftware.de