Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP inlist() in c#
Message
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01320903
Message ID:
01564094
Views:
34
>>>>If I try
>>>>
>>>>Int16 closeDrawers = 2;
>>>>
>>>>if (closeDrawers.InList(2,4))
>>>>
>>>>
>>>>
>>>>I get an error about Short don't have InList implemented. I bypassed it by using Int32 instead but just wondering what was wrong in the above.
>>>
>>>Remind us how you are currently implementing InList() ....
>>
>>
>> public static bool InList<T>(this T s, params T[] list)
>>        {
>>            return list.Contains(s);
>>        }
Don't see how that works. Arrays don't implement .Contains()......

Seems to be working great for me so far. It is from Gregory's solution from 2008. I've been reading the whole thread yesterday's night.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform