本来であれば計算の前に入力チェックするべきだが、まぁサンプルということで。 エラー情報(Errオブジェクト) 実行時エラーの内容は Err オブジェクトに格納される。 Err オブジェクトは以下のプロパティとメソッドを持つ。 Numberプロパティ エラー番号。正常なら 0 、異常なら 0 以外 ...
続けて、計算の次の行にエラー有無の判定とエラー処理を書く。 エラー有無は Err.Number で判定できる。 Err.Number には処理結果が正常なら 0 が、異常なら 0 以外が設定される。 なので Err.Number ≠ 0 だったらエラー処理を行うようにする。 今回のエラー処理は、エラーの詳細をメッセージボックス ...
This repository demonstrates a common error in VBScript functions: the absence of error handling for potential division by zero. The bug.vbs file shows the faulty ...
This repository demonstrates a common error when using the GetObject function in VBScript and provides a solution for handling it gracefully. The GetObject function ...