Data update
This commit is contained in:
parent
52a6ef48dd
commit
157b70a810
604 changed files with 14253 additions and 2100 deletions
29
Task/Exceptions/FutureBasic/exceptions-1.basic
Normal file
29
Task/Exceptions/FutureBasic/exceptions-1.basic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
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
|
||||
15
Task/Exceptions/FutureBasic/exceptions-2.basic
Normal file
15
Task/Exceptions/FutureBasic/exceptions-2.basic
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
void local fn ThrowException
|
||||
ExceptionRef e = fn ExceptionWithName( @"Oops!", @"Something went wrong", NULL )
|
||||
|
||||
try
|
||||
throw e
|
||||
end try
|
||||
|
||||
catch (e)
|
||||
print fn ExceptionName( e ), fn ExceptionReason( e )
|
||||
end catch
|
||||
end fn
|
||||
|
||||
fn ThrowException
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue