RosettaCodeData/Task/Exceptions/FutureBasic/exceptions-1.basic

30 lines
475 B
Text
Raw Permalink Normal View History

2024-11-04 20:28:54 -08:00
void local fn DoSomething
CFStringRef obj
ExceptionRef e
CFArrayRef array = @[@"Alpha",@"Bravo",@"Charlie"]
try
print @"<try>"
obj = array[3] // if exception, go to catch -->
print obj
print @"no exception"
end try
catch ( e ) // handle exception
print : print @"<catch>"
print e
end catch
finally // finally is always executed
print : print @"<finally>"
// ... cleanup
end finally
end fn
fn DoSomething
HandleEvents