getPrivateString
Get a string defined in a private lookup table that matches the specified lookup ID.
Note: Use the getPrivateString function if the lookup table has an ID. If the lookup table has no ID, use the getString function. For more information about the getString function, see getString on page 163.
Syntax
ogscript.getPrivateString (Lookup ID, Key);
Parameters
Parameter |
Type |
Required |
Description |
Lookup ID |
String |
Yes |
ID of the string to find in the specified lookup table. |
Key |
String |
Yes |
Private lookup table in which to find the specified string. |
Returns
String
Example
This example uses the getPrivateString function to read an IP address stored in a lookup table. The lookup table is defined at the beginning of the .grid file, and can be accessed by any script.
The lookup table definition for this example is as follows:
<lookupid="hosts">
<entry key="XPression.host">10.0.2.210</entry>
<entry key="XPression.port">7788</entry>
</lookup>
The script to read an entry from the lookup table is as follows:
//Get the IP Addressassociated with entry key XPression.host
var host = ogscript.getPrivateString('hosts',' XPression.host ');