# OpcRange Struct

<span class="api-meta">since v2.24</span>

<dl class="api-definition">
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Members</dt>
<dd><a href="./members">OpcRange Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Represents a range used to identify a single element or a range of elements in a structure or an array using their zero-based indexes.

## Syntax

<div class="api-signature" data-lang="csharp">

```csharp
public readonly struct OpcRange
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
<OpcDataType(291)>
Public Structure OpcRange
```

</div>

## Implements

<ul class="api-implements">
<li><a href="https://learn.microsoft.com/dotnet/api/system.icomparable">IComparable</a></li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.icomparable-1">IComparable</a>&lt;OpcRange&gt;</li>
<li><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable</a>&lt;OpcRange&gt;</li>
</ul>

## Remarks

A single element can be identified using an OpcRange just with a [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) value.

A range of elements can be identified using an OpcRange with a [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) and [End](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#end) value.

A range of elements in a subsequent dimension can be identified using an OpcRange with a [Next](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#next) value.

## Constructors

| Name | Description |
|---|---|
| [OpcRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#opcrange)<span class="api-meta">4 overloads</span> | Initializes a new instance of the OpcRange with the specified `start` index of a single element. |

## Fields

| Name | Description |
|---|---|
| [Empty](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#empty)<span class="api-meta">static</span> | Stores the value used to identify an undefined OpcRange. |

## Properties

| Name | Description |
|---|---|
| [Dimensions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#dimensions) | Gets the total number of dimensions identified by this and its subsequent OpcRange values (see [Next](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#next)). |
| [End](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#end) | Gets the index of the last element in the range. |
| [Length](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#length) | Gets the total number of elements identified by this OpcRange. |
| [Next](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#next) | Gets the OpcRange for the next dimension within this OpcRange. |
| [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) | Gets the index of the first element in the range. |

## Methods

| Name | Description |
|---|---|
| [CompareTo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#compareto)<span class="api-meta">2 overloads</span> | Compares the current OpcRange with the `other`. |
| [Equals](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#equals)<span class="api-meta">2 overloads</span> | Determines whether the specified `other` is equal to this OpcRange. |
| [GetHashCode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#gethashcode)<span class="api-meta">override</span> | Retrieves a hash code for this OpcRange. |
| [Of](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#of) | Determines the OpcRange which applies to the `dimension` specified. |
| [Parse](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#parse)<span class="api-meta">static</span> | Converts the specified [string](https://learn.microsoft.com/dotnet/api/system.string) to its OpcRange equivalent. |
| [ToString](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#tostring)<span class="api-meta">override</span> | Converts the value of this instance to its equivalent string representation. |
| [TryParse](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#tryparse)<span class="api-meta">static</span> | Tries to convert the specified [string](https://learn.microsoft.com/dotnet/api/system.string) to its OpcRange equivalent. |

## Operators

| Name | Description |
|---|---|
| [Equality](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-equality)<span class="api-meta">static</span> | Returns a value indicating whether two values of OpcRange are equal. |
| [Explicit](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-explicit)<span class="api-meta">static · 2 overloads</span> | Converts a OpcRange to a [string](https://learn.microsoft.com/dotnet/api/system.string) object. |
| [GreaterThan](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-greaterthan)<span class="api-meta">static</span> | Determines whether the first specified OpcRange value is greater than the second specified OpcRange value. |
| [GreaterThanOrEqual](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-greaterthanorequal)<span class="api-meta">static</span> | Determines whether the first specified OpcRange value is greater than or equal to the second specified OpcRange value. |
| [Implicit](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-implicit)<span class="api-meta">static · 4 overloads</span> | Converts an [int](https://learn.microsoft.com/dotnet/api/system.int32) to a OpcRange value using the `value` as the [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#start) of the OpcRange. |
| [Inequality](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-inequality)<span class="api-meta">static</span> | Returns a value indicating whether two values of OpcRange are not equal. |
| [LessThan](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-lessthan)<span class="api-meta">static</span> | Determines whether the first specified OpcRange value is less than the second specified OpcRange value. |
| [LessThanOrEqual](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrange/members#op-lessthanorequal)<span class="api-meta">static</span> | Determines whether the first specified OpcRange value is less than or equal to the second OpcRange value. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.24–v2.59 |
