Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax help VB.NET
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01399843
Message ID:
01399888
Views:
55
>Hi Cetin,
>
>Thank you very much for your reply. I am still trying to understand the syntax. What is Function(v) v ? Is that the function that I have to create to extract first element of the array?
>

Function(v) is a delegate automatically defined by the .NET framework in 3.5. Basically what's happening here is an array of numbers gets passed to an extension method named Where. Where accepts a delegate of type Function. "v" represents a variable for a single element in the array. Where() essentially iterates over the collection calling the Function delegate with each value. The "v <> 0" code represents code run by that function (pretend you created a delegate named Function that had this code in it). That filters out the 0 amounts.

The next extension method takes the resulting array and passes it to another extension method named "All" which basically checks to see if all the elements in the list match the condition passed in. It does the same thing as the Where - it iterates over the elements comparing them against the max value found in those elements.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform