我正在尝试在try catch中包装简单的语句。问题是,我能够找到的所有例子都谈到了预先定义的错误。
我需要一个通用的错误,类似于C#中的try/catch。
发布于 2013-07-10 02:03:36
对于一般的try catch,您可以这样做:
try
...put some code here
catch
...do something for ANY exception here.
finally
...code here that runs IF an exception occurs
end trycatch部分有可选的参数来捕获某些类型的错误(如您所见的例子)。第一段给出了http://docs.xojo.com/index.php/Try中的定义
Try
// Your code
Catch [ErrorParameter] [As ErrorType]
//exception handlers
[ Finally ]
//code that executes even if runtime exceptions were raised
End [Try]https://stackoverflow.com/questions/17554505
复制相似问题