Connectivity Software User's Guide and Reference
FindNarrowestUIntegerType Method



OpcLabs.EasyOpcUAPrimitives Assembly > OpcLabs.EasyOpc.UA Namespace > UAType Class : FindNarrowestUIntegerType Method
The value or array to analyze. Can be a scalar or multidimensional array.

The value of this parameter cannot be null (Nothing in Visual Basic).

Finds the narrowest unsigned integer .NET type that can represent the specified value or array of values.
Syntax
'Declaration
 
<JetBrains.Annotations.NotNullAttribute()>
Public Shared Function FindNarrowestUIntegerType( _
   ByVal value As Object _
) As Type
'Usage
 
Dim value As Object
Dim value As Type
 
value = UAType.FindNarrowestUIntegerType(value)
[JetBrains.Annotations.NotNull()]
public static Type FindNarrowestUIntegerType( 
   object value
)
[JetBrains.Annotations.NotNull()]
public:
static Type^ FindNarrowestUIntegerType( 
   Object^ value
) 

Parameters

value
The value or array to analyze. Can be a scalar or multidimensional array.

The value of this parameter cannot be null (Nothing in Visual Basic).

Return Value

The narrowest unsigned integer type (Byte, UInt16, UInt32, or UInt64) that can hold all values, preserving array rank if applicable.

This method never returns null (Nothing in Visual Basic).

Remarks

This method analyzes the magnitude of the value(s) and determines the smallest unsigned integer type that can represent them. For arrays, it examines all elements and returns an array type of the appropriate rank.

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