OPC Studio User's Guide and Reference
FindByDecimalValue Method (_EnumerationDataType)



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.DataTypeModel.ComTypes Namespace > _EnumerationDataType Interface : FindByDecimalValue Method
The enumeration value to be found.
Finds an enumeration member by its value.
Syntax
'Declaration
 
<JetBrains.Annotations.CanBeNullAttribute()>
Function FindByDecimalValue( _
   ByVal value As Decimal _
) As EnumerationMember
'Usage
 
Dim instance As _EnumerationDataType
Dim value As Decimal
Dim value As EnumerationMember
 
value = instance.FindByDecimalValue(value)
[JetBrains.Annotations.CanBeNull()]
EnumerationMember FindByDecimalValue( 
   decimal value
)
[JetBrains.Annotations.CanBeNull()]
EnumerationMember^ FindByDecimalValue( 
   decimal value
) 

Parameters

value
The enumeration value to be found.

Return Value

Returns an OpcLabs.BaseLib.DataTypeModel.EnumerationMember which has the value given by the value parameter. When there is no such enumeration member, the function returns a null reference. When there is more than one match, the first matching enumeration member found is returned.

This method can return null (Nothing in Visual Basic).

Exceptions
ExceptionDescription

The value of an argument is outside the allowable range of values as defined by the invoked method.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

Remarks

For finding an enumeration value that corresponds to given name, use the fact that EnumerationMembers is a collection keyed by the enumeration member names.

This member is not compatible with VBScript.

This member or type is for use from COM. It is not meant to be used from .NET or Python. Refer to the corresponding .NET member or type instead, if you are developing in .NET or Python.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also