Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP inlist() in c#
Message
 
To
02/06/2008 06:46:55
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01320903
Message ID:
01320965
Views:
45
Here is how the VFP toolkit for .NET did it:
/// <summary>
/// Receives an expression and a list of values as parameter and returns a true
/// if the expression exists in the list. Please note that the Visual FoxPro's
/// InList() function has a limitation of in items whereas this one does not have
/// a limitation on the number of items passed.
/// </summary>
/// <example>
/// Console.WriteLine(InList("Kamal", "Pat", "abc", "Kamal"));	//returns true
/// Console.WriteLine(InList("Kamal", "Pat", "abc", "xyz"));	//returns false
/// Console.WriteLine(InList(123, 12, 13, 16, 1717, 123));	//returns true
/// </example>
/// <param name="tcExpression"></param>
/// <param name="toVar"></param>
/// <returns></returns>
public static bool InList(object toExpression, params object[] toItems)
{
	return Array.IndexOf(toItems,  toExpression) > -1;
}
>if there any similar vfp inlist() command in C#?
>
>
>for eg.
>
>VFP Code:
>
>IF INLIST(postCode,'001','002','003')
>...
>ENDIF
>
>
>
>Thanks.
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform