|
|
This is NOT the latest version, which is available at: current
Exception Handling in DaoDao exceptions are organized into hierarchal structured classes. The base class is Exception ,
class Exception( content='' )
Currently supported classes are the following:
{ protected my Rout = ''; my File = ''; my FromLine = 0; my ToLine = 0; public my Name = 'Exception'; my Content : any = 'undefined exception'; if( content ) Content = content; }
Any running time error will raise a proper exception instance. User-defined exception can be raised by using raise statement. Exceptions can be rescued by a block of code after a rescue statement The exception handling syntax is the following:
stmt_tryrescue ::=
where expr is a list of exception class(es).
If there is no expr following rescue , any exception will be rescued.
There can be multiple rescue statements in a try-rescue block.
The raised exceptions will be checked against the exception classes presented in
each of the rescue statement, if there is a matching, the corresponding code
block is executed, and the rescued exceptions can be accessed in a global list named
exceptions . In the same try-rescue block different rescue statements
can be used to handle different exceptions. 'try' '{' stmt_block { '}' 'rescue' [ '(' expr ')' ] '{' stmt_block }* '}' If all rescue statements have been tried and there is still un-rescued exception(s), the current function is aborted and the exceptions(s) is raised to its caller, if there is; otherwise, the program is aborted with the values of the un-rescued exceptions printed out. In a rescue statement, one may modify exection condition, and use retry to invoke the codes in try block. Examples,
try{
raise Exception.Error( "error test" ), Exception.Warning( "warning test" ), Exception( "exception" ); }rescue( Exception.Error, Exception.Warning ){ stdio.println( exceptions ); }rescue{ stdio.println( "rescued" ); }
view count 168 times
created at 2009-09-18, 06:38 GMT |
klabim: ... Ok, I found it. It can be so easy by reading the documentation :- ). I have overseen the keyword glob ... (Aug.21,18:09) klabim: sharing vars between scripts Hi, how can I share a variable between 2 scripts in an embedded environment? For example: script 1: ... (Aug.21,17:55) |