TRY ブロックを使用すると、実行時に発生する可能性のある例外についてコードのセクションをテストできます。CATCH ブロックでは、TRY ブロックの実行時に例外が発生した場合に処理する例外のタイプを指定する必要があります。FINALLY ブロックを使用すると、例外が発生したかどうかにかかわらず、TRY ブロックの後にコードのセクションを実行できます。
*> The example below shows that you can declare e at the point of use. *> It is in scope until the end-try. try display "exception test" catch e as type Exception display e::Message end-try
ローカル変数のサンプルおよび例外処理のサンプルも参照してください。これらのサンプルは、Start > All Programs > Micro Focus Enterprise Developer > Samples > Visual COBOL Samples、COBOL for .NET の場合の場合。 に用意されています。