objGlobal

RAMP-NL

objGlobal


objGlobal can be used to store your own properties.

This can be useful if you need to store information from one script and use it later in another script.

The information could be field values from a screen that need to be referred to by a later script.

Or it could identify which path a script is on, so that when the same screen is used by two paths, the script can determine which path it is on.

Property

Type

Description

<<any property name>>

string

Any property you want to assign to

Example

Save the path the user is on, and the item the user is working with (On Screen 1).

/* Store the Item number that the user entered  - this field has to be defined on this form in newlook*/

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.");

 

Note that objGlobal is global within a 5250 session. Each 5250 session has its own unique instance of objGlobal.

For more information refer to Using the objGlobal Object.