Say I created a method void test (byte var) and the var only take a number in the Range(1, 3) only.
How can I define the "var" to make this possible??
Say I created a method void test (byte var) and the var only take a number in the Range(1, 3) only.
How can I define the "var" to make this possible??
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Scott LyslePosted Jun 6, 2008, 10:57 AM
private string Test(byte b)
{
if (b >= 1 && b <= 3)
{
return "Good enough";
}
else
{
return "Out of range";
}
}