Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Syntax help VB.NET
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01399843
Message ID:
01399888
Vues:
56
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform