New topic: Catching Unsupported Format Exceptions and nilobjectexceptio
<http://forums.realsoftware.com/viewtopic.php?t=30444> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message DanSandbergUCONN Post subject: Catching Unsupported Format Exceptions and nilobjectexceptioPosted: Mon Oct 12, 2009 2:58 pm Joined: Fri Dec 21, 2007 9:50 am Posts: 165 I'm trying to create a program with preferences which dictate the location of other programs, etc. I have the following source: Code: function checkexists(dpath as string) as boolean dim d as folderitem d=GetFolderItem(dpath, folderitem.PathTypeShell) if d<>nil and d.exists then return true else beep beep beep msgbox (d.Name+" was not found!") return false end if exception beep beep beep beep beep MsgBox(dpath+" is not a recognized file. Please check the program preferences.") return false end function This function is supposed to accept a shell path (which is in the preferences .txt file) and either catch the nilobjectexception, catch the unsupportedformatexception, or tell the user if the file doesnt exist. The latter function works but it does not catch the exceptions. Am I using the wrong format? Neither exception nor try seem to work for me. 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 [email protected]
