New topic: Trapping NilObjectExceptions
<http://forums.realsoftware.com/viewtopic.php?t=24876> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message brianheibert.com Post subject: Trapping NilObjectExceptionsPosted: Mon Oct 20, 2008 12:09 pm Joined: Thu Jan 25, 2007 7:38 pm Posts: 371 Location: Loveland, OH USA OK I got this: Code: dim f as folderItem dim path as string f = GetOpenFolderItem (opentypes.SpecialDisk+opentypes.SpecialFolder+opentypes.Any) path = f.absolutepath CopyMate.OrigFilePath.text = path Now how do I trap for NilObjectExceptions Do I use f or path? Brian Top timhare Post subject: Re: Trapping NilObjectExceptionsPosted: Mon Oct 20, 2008 12:33 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 3565 Location: Portland, OR USA You should test f for nil before you use it. Code:dim f as folderItem dim path as string f = GetOpenFolderItem (opentypes.SpecialDisk+opentypes.SpecialFolder+opentypes.Any) if f<> nil then path = f.absolutepath CopyMate.OrigFilePath.text = path end Top brianheibert.com Post subject: Re: Trapping NilObjectExceptionsPosted: Mon Oct 20, 2008 12:38 pm Joined: Thu Jan 25, 2007 7:38 pm Posts: 371 Location: Loveland, OH USA ok thanks _________________ Brian Heibert http://www.brianheibert.net [EMAIL PROTECTED] Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 900 classes with 18000 functions in one REALbasic plug-in. The Monkeybread Software Realbasic Plugin v8.1. <http://www.monkeybreadsoftware.de/realbasic/plugins.shtml> [email protected]
