Extensions.DataType.GetEnumerationByName
Jump to navigation
Jump to search
Contents
Classification
Name | GetEnumerationByName |
Short Description | Returns the name in the specified enumeration by the given name |
Class | Term |
Extension | OTX DataType extension |
Group | GetEnumerationByName related terms |
Exceptions | OutOfBoundsException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
/// Local Declarations
EnumerationSignature EnumerationVariable = EnumerationSignature.EnumerationElement;
/// Flow
EnumerationVariable = DataType.GetEnumerationByName(StringTerm, OtxLink);
Description
GetEnumerationByName is a term that returns the name in the specified enumeration by the given name.
If the enumeration value does not exist, the OutOfBoundsException exception will be thrown.
Return Value
The Term returns the value, see table below.
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Enumeration | Returns the name corresponding to the given name. |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
ElementName | String | Term | - | [1] | The element name to be checked inside the specified enumeration. |
Enumeration | OtxLink | - | - | [1] | This attribute identifies the specified enumeration to check the name. The link will point to the corresponding EnumerationSignature. |
OTL Examples
package DataType.EnumerationSignature EnumerationSignature1(Integer EnumerationElement1 = 7, Integer EnumerationElement2 = 12);
/// Global Declarations
public procedure main()
{
/// Local Declarations
EnumerationSignature1 enumeration1 = EnumerationSignature1.EnumerationElement1;
/// Flow
enumeration1 = DataType.GetEnumerationByName("EnumerationElement2", EnumerationSignature1);
}
See also
EnumerationContainsName
EnumerationContainsValue
EnumerationGetEntryList
GetEnumerationByValue
StructureCopy