テキスト書式の各項目には、変更データ・タグがあります。変更データ・タグは、書式が最後に表示されたときに、ユーザーが書式項目を変更したと考えられるかどうかを示す、状況値です。CICS® と関係する変更データ・タグの利点の 1 つは、ユーザーからプログラムに転送されるデータに、ユーザーが変更したと考えられる項目のみが組み込まれるため、ネットワーク・トラフィックが少なくなることです。
後で説明するように、項目の変更データ・タグは、項目の modified プロパティーとははっきりと区別されます。 このプロパティーは、プログラム内で設定されるもので、変更データ・タグの値を事前設定します。
ユーザーは、項目内に文字を入力するか、文字を削除することによって、変更データ・タグを設定します。書式を処理依頼する前に、ユーザーがフィールドの内容を表示時の値に戻した場合でも、変更データ・タグは設定されたままとなります。
エラーのために書式が再表示された場合、その書式は依然として同じ converse 文を処理しています。この結果、書式が再表示されたとき、converse で変更されたすべてのフィールドは変更データ・タグが yes に設定されています。例えば、バリデーター機能を持つフィールドにデータを入力した場合、この機能が ConverseLib.validationFailed 関数を呼び出し、エラー・メッセージを設定して書式の再表示を引き起こす場合があります。 この場合、フィールドの変更データ・タグは yes に設定されたままなので、アクション・キーが押されると、バリデーター機能が再度実行されます。
set 文は、変更データ・タグの現在の設定ではなく、modified プロパティーの値に影響します。 タイプ if item modified のテストは、書式データが最後にプログラムに戻されたときに有効だった、変更データ・タグの値に基づきます。 論理が書式を最初に表示する前に、項目の変更データ・タグをテストしようとすると、実行時にエラーが発生します。
変数書式項目のいずれかの変更データ・タグが yes に設定されている場合、書式全体が変更済みとして認識されます。 ユーザーに対してまだ表示されていない書式の変更状況をテストすると、そのテスト結果は FALSE になります。
以下の論理は、さまざまなテストの結果を示しています。
// tests false because a converse statement // was not run for the form if (form01 is modified) ; end // causes a run-time error because a converse // statement was not run for the form if (item01 is modified) ; end // assume that the user modifies both items converse form01; // tests true if (item01 is modified) ; end // tests true if (item02 is modified) ; end // sets the modified property to no // at the next converse statement for the form set item01 initialAttributes; // sets the modified property to yes // at the next converse statement for the form set item02 initialAttributes; // tests true // (the previous set statement takes effect only // at the next converse statement for the form if (item01 is modified) ; end // assume that the user does not modify either item converse form01; // tests false because the program set the modified // data tag to no, and the user entered no data if (item01 is modified) ; end // tests true because the program set the modified // data tag to yes if (item02 is modified) ; end // assume that the user does not modify either item converse form01; // tests false if (item01 is modified) ; end // tests false because the presentation was not // the first, and the program did not reset the // item properties to their initial values if (item02 is modified) ; end