LookupValue
Syntax
LookupValue (mapName, referenceElementName, referenceValue, elementName, defaultValue, needAnException)
Description
Locate the reference element value in a domain value map, and return the equivalent value for the specified element name. This form of DVM lookup is used to find a single reference element and return a single element value.
Parameters
| Parameter | Description |
|---|---|
|
mapName |
Name of a static value map definition (DVM), as string. |
|
referenceElementName |
Name of an element in the DVM in which to look for a value, as string. |
|
referenceValue |
Value of an element in the DVM to look for, as string. |
|
elementName |
Name of the element in the DVM to return an equivalent value for, as string. |
|
defaultValue |
Default value to be returned if needAnException is false and an error occurs, as string. |
|
needAnException |
True to return error messages, false to return the default value. |
Returns
The equivalent value of elementName in the DVM, or the default value.
Example
This example is used to look up the value &guid1 in the UniqueGUID element of the &TestName DVM and return the equivalent value of element &EBS1.
Local string &returnValue = &dvm.LookupValue(&TestName, &UniqueGUID, &guid1,⇒
&EBS1, "Value not found.", True);
This example will look up a value that does not exist in element &EBS1 of the &TestName DVM to verify that the default value is returned when the NeedAnException parameter is false.
&returnValue = &dvm.LookupValue(&TestName, &EBS1, "NotFound", &UniqueGUID, &Value⇒
NotFound, False);