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

30 lines
475 B
Plaintext

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