New topic: Trap for a error when no items are found in listbox...
<http://forums.realsoftware.com/viewtopic.php?t=33082> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message brianheibert Post subject: Trap for a error when no items are found in listbox...Posted: Sat Mar 20, 2010 6:24 pm Joined: Sat Jan 23, 2010 3:03 pm Posts: 105 How can I trap for a error lets say my minus button has deleted all there is in the listbox and the user hits minus again, Instead of the program hiccuping it displays a msgbox "Cannot remove row because row cannot be found." or something like that. The plus & minus control I am using is a canvas and both plus and minus buttons are drawn into one canvas so I can't just disable the button (or canvas in this case) _________________ Brian Heibert brianheibert.net insanemonkeysoftware.com [email protected] Top jefftullin Post subject: Re: Trap for a error when no items are found in listbox...Posted: Sat Mar 20, 2010 6:35 pm Joined: Wed Nov 15, 2006 3:50 pm Posts: 1408 you can trap for errors using a try..catch construct. you can try checking that listbox.listindex is greater than -1 before you do the remove row You can try checking that listbox.listcount is greater than 0 before you do the remove row. You can try something... Quote:The plus & minus control I am using is a canvas and both plus and minus buttons are drawn into one canvas so I can't just disable the button (or canvas in this case) Why not? Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- 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 [email protected]
