From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

What is Range IOpComparison argument for?

Solved!
Go to solution

There are 2 overloads for Range but I can't find any examples on the 3rd argument - IOpComparison.

 

Could you please point me to some example or perhaps provide one... Curious what it does.

 

Thanks!

0 Kudos
Message 1 of 3
(3,184 Views)
Solution
Accepted by topic author kirko7

Hi kirko7,

The optional IOpComparison argument is for cases when you wish to specify a different or custom comparer for the TData values within that range. The documentation for this can be found in the Measurement Studio help within Visual Studio, including full documentation on the members of each class. I've linked the documentation for that specific Range constructor you are referencing, which describes IOpComparison as the instance of a comparer used to compare minimum and maximum. This would be useful in cases where the default comparison method would not suffice for your application when determining if something is within range or not. 

Unfortunately I could not track down an example or a link to a help page, but you should be able to find the same documentation I looked at in the Measurement Studio Help from within Visual Studio. Just search for "Range(TData)" to find the Range Constructor page, and you should be able to navigate from there to the specific constructor and documentation on IOpComparison. 
 

Charlie J.
National Instruments
Message 2 of 3
(3,172 Views)

Thanks, I will take a look at some point... I was just curious as I notices the 3rd overload by accident (auto coplete option).

 

0 Kudos
Message 3 of 3
(3,169 Views)