Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax help VB.NET
Message
From
14/05/2009 17:55:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
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:
01399986
Views:
46
>>
double[] values = {250.99,0,250.99};
>>bool valuesEqual = values.Where( v => v != 0).All( v => v == values.Max() );
>>
>>Oh VB it is, then:
>>
>>
dim values as double() = {250.99,0,250.99}
>>dim valuesEqual as boolean = values.Where( Function(v) v <> 0).All( Function(v) v = values.Max() )
>>
>>
>>
dim valuesEqual as boolean = (values.Where( Function(v) v <> 0).Distinct().Count <= 1)
>>
>
>Cool use of LINQ/Lambdas.

Thanks, I like Linq. Thanks for the explanation too, I wouldn't be able to handle it so nicely.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform