パラメーター・リストでのエラーの確認
Z and I Emulator for Web は、エンド・ユーザーがマクロを再生するまで、パラメーター・リストでエラーをチェックしません。エンド・ユーザーがマクロを再生するとき、Z and I Emulator for Web がパラメーター・リストでエラーを検出すると、Z and I Emulator for Web は以下のことを実行します:
- マクロの再生を終了する。
- エンド・ユーザーに対してエラー・ダイアログ・ボックスを表示するか、メッセージ を Java コンソールに書き込んで、エラー・メッセージを生成する。
Z and I Emulator for Web は、3 つのタイプのエラー状態を検査します。
- 指定された変数がマクロに存在しない。
このタイプのエラーでは、マクロに存在しないか、または間違って入力されている (例えば、
strLocalFileではなくstrLocalfile) 変数名がパラメーター・リストに含まれています。このタイプの問題を回避するために実行できるアクションは、次のとおりです。- エンド・ユーザーに変数名を正しく入力するよう警告する。または
- メイン・ツールバーで、正しいパラメーター・リストを使用したマクロを再生する カスタマイズされたボタンを作成する。
- 構文エラーがパラメーター・リストに存在する。
このタイプのエラーでは、パラメーター・リストに構文エラー (例えば、 値が二重引用符で囲まれていない) があります。
このタイプの問題を回避するために実行できるアクションは、次のとおりです。- エンド・ユーザーに構文規則を守るように警告する。または
- メイン・ツールバーで、正しいパラメーター・リストを使用したマクロを再生する カスタマイズされたボタンを作成する。
構文エラーの例 には、構文エラーの例と、Z and I Emulator for Web のエラーの処理方法が記載されています。図 1. 構文エラーの例 strRemoteFile="NewData.123 intLength="14622"Z and I Emulator for Web : 1) Sets the variable strRemoteFile to "NewData.123 intLength=". 2) Tries to process 14622" but cannot (Z and I Emulator for Web is looking for a variable name but instead finds an integer followed by a double quote). 3) Terminates the macro playback and generates an error message. strRemoteFile="NewData.123"98 strLocalFile="MyData.123"Z and I Emulator for Web : 1) Sets the variable strRemoteFile to "NewData.123". 2) Tries to process 98 but cannot (Z and I Emulator for Web is looking for a variable name but finds an integer). 3) Terminates the macro playback and generates an error message. strRemoteFile=NewData.123 strLocalFile=MyData.123Z and I Emulator for Web : 1) Does not find a double quote after the first equals sign (=). 2) Terminates the macro playback and generates an error message. - ランタイム・エラーが発生する。 ランタイム・エラーを引き起こすパラメーター・リストの問題の例は、次のとおりです。
上記の例では、変数intLength="abc"intLengthのタイプは整数です。Z and I Emulator for Web は、ストリングabcを 10 進の整数に変換しようとして、失敗します。ランタイム・エラーが発生すると、Z and I Emulator for Web は以下のことを実行します:- マクロの再生を終了する。
- エラー・メッセージを含むエラー・ダイアログ・ボックスを表示する。
上のランタイム・エラーの例では、Z and I Emulator for Web は、以下のようなメッセージを含むエラー・ダイアログ・ボックスを表示します:
A type mismatch occurred while updating variable $intLength$。