You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Reading values
Scripts can read values from the instance list like this:
myVariable = objListManager.Akey3[0];
 
See [<span style="color: #0000ee"><span style="text-decoration: underline; ">Visual and Programmatic Identifiers</span></span>].
 
If the user has selected several entries in the instance list, you can read all the values in a loop like this:
var i = 0;
var strMessage = "";
for (i = 1; i <= objListManager.TotalSelected; i++)
{
    strMessage += "Selected Employee " + objListManager.AKey3[i] + " ";
}
alert(strMessage);
 
Or from a field defined on a 5250 screen like this:
MyVariable = GETVALUE("utxtEmployeeCode");
 
Writing values
The script can put values on the screen like this:
SETVALUE("utxtEmployeeCode", "myText");
 
Storing values
You can store values in Javascript variables and then read and write from them:
Var MyString = "";
MyString = objListManager.Akey3[0];
  
These variables exist only while the script is running. To share information between scripts, you need to create and set a property for [<span style="color: #0000ee"><span style="text-decoration: underline; ">objGlobal </span></span>]:
objGlobal.uLastValue = "anything";
 
Then another script can read this value:
myVariable = objGlobal.uLastValue;
 
Getting script pieces quickly
[<span style="color: #0000ee"><span style="text-decoration: underline; ">Using the Scripting Pop-up Menu</span></span> ]
 

  • No labels