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