Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to iterate through lambda query.

Status
Not open for further replies.

WomanPro

Programmer
Nov 1, 2012
180
GR
Supposing the following code, is it possible to incorporate the iterator of the for loop to the lambda expression
Is it a good idea to do it and how? The what I want to do is not to use the for loop statement but do the work of iteration of the loop inside the lambda query.
Thank you so much in advanced.

Code:
Public Sub UCheck(ByVal n As Byte)

UsrCheckerGates = PcCheckerGates

UsrCheckerGates(1).ReversePos = 100

Dim PG As IEnumerable(Of GatesPositions)

PG = PcCheckerGates.Where(Function(x) x.pos > 50)

Dim uany As Boolean

For us As Byte = 1 To 3

Dim f = us

uany = PG.Any(Function(x) UsrCheckerGates.Any(Function(u) u.ReversePos = x.pos - f * 50))

Next

End Sub

However, I tried the following code, but I can't find a way to access the .value property through iteration inside the lamdba expression
Dim frst = PG.First(Function(x) UsrCheckerGates.Any(Function(u) u.ReversePos = WHAT?
Any suggestions please? Any help will be much appreciated.

Code:
Dim test3 = PG.Select(Function(x) New With {
                         .Position = x.pos,
                         .Dice = 50,
                         .multiple = Multiples.Select(Function(q) New With {
                         .value = x.pos - (q * 50)})})
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top