objGlobal
objGlobalを使用して独自のプロパティを格納できます。
これは、1つのスクリプトから情報を格納し、その情報を後で別のスクリプトで使用する必要がある場合に役に立ちます。
その情報には、後のスクリプトで参照される必要のある、画面からのフィールド値などを使用できます。
また、スクリプトが通ってきたパスを特定することもできます。したがって、同じ画面が2つのパスから使用されている場合、そのスクリプトは自身が通ってきたパスを判別できます。
プロパティ | タイプ | 説明 |
<<任意のプロパティ名>> | 文字列 | 割り当て先の任意のプロパティ |
例
ユーザーが通ってきたパスとユーザーが作業を行っているアイテムを保存します(画面1)。
/* Store the Item number that the user entered - this field has to be defined on this form*/
objGlobal.utxtItemNumber = GETVALUE("utxtItemNumber");
/* Store the action that is being performed (so that shared screens can know whether its an add or a copy) */
objGlobal.uLastAction = "COPY";
Remember the path the user is on, and the item the user is working with (On Screen 4).
/* Get the action that is being performed */
if (objGlobal.uLastAction == "COPY")
{
ALERT_MESSAGE("Inventory item ", objGlobal.utxtItemNumber, " was copied from " , objListManager.AKey1[0] );
}
else
{
ALERT_MESSAGE("Inventory item was added.", objGlobal.utxtItemNumber , "has been saved.");
objGlobalは5250セッション内でグローバルであることに注意してください。各5250セッションには独自のobjGlobalインスタンスがあります。
詳細については、「objGlobalオブジェクトの使用」を参照してください。