switch クラス : IsError ゲッタ
説明
ハンドラの前回の実行で例外が発生したかどうかを示す値を返します。
構文
instance.IsError
引数
無し。
返り値
| クラス | 説明 |
| bool | ハンドラの前回の実行で例外が発生したかどうかを示す値。 |
サンプルコード
次のクラス定義があるとします。
| 1: | class handle |
| 2: | open method void LCHandler(dictionary dic) |
| 3: | throw "exception"; // Exception occurs. |
| 4: | endmethod |
| 5: | endclass |
IsError ゲッターの使い方は次のとおりです。
| 1: | browser b = new browser(); |
| 2: | message m; |
| 3: | handle h = new handle(); |
| 4: | switch sw = b.LoadCompleted(h,"LCHandler(dictionary)"); |
| 5: | sw.StopWithException = false; // Non-stop event handler. |
| 6: | sw.ShowException = false; // No error message dialog. |
| 7: | sw.Start(); // Start event handler. |
| 8: | _br.LoadUrl("https://example.com/", true); // It is synchronously page loading. |
| 9: | sleep slp. |
| 10: | slp.Freeze(10000); // It wait 10sec, the handler will be called and an exception will be thrown. |
| 11: | bool occur = sw.IsError; // It returns true because the handler will throw exception. |
注意
ハンドラの前回の実行で例外が発生した場合は true を返します。それ以外の場合は false を返します。
参照リンク
無し。


