VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,846 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hallo,
I am looking for an idea or easiest way to find a object which satisfies the criteria. for example below is my list .
for example, if a have a value of 100, i want to look in the VMin and VMax column , if my value resides or equal in this range i want to get the P1, P2,P3, P4 values . With value of 100 i should get the 2nd row. if my value is 35 then i should get 4 th row.
Thanks
Something like this should work:
Dim mydata as List(Of MyClass) = . . .
Dim value as Integer = 100
Dim found_object as MyClass = mydata.FirstOrDefault(Function(d) value >= d.VMin AndAlso value <= d.Vmax)
If found_object IsNot Nothing Then
Dim P1 = found_object.P1
Dim P2 = found_object.P2
Dim P3 = found_object.P3
Dim P4 = found_object.P4
. . .
End If
Can be adjusted according to your real classes.
sorry there is a typo. i mean 350.