|
Thread: Os?
-
Oct 27th, 2005, 06:03 AM
#19
Banned
Re: Os?
spin soem? what is that?
he has some code i can give you. he asked me to port it fro him, nearly finished
public Class UserInput
{
public static double GetUserNum(string prompt double def, double lower, double upper, bool include, bool AllowErrMsg)
{
string temp;
double test = 0;
Console
temp = Console.ReadLine();
{try
test = double.Parse(temp); //convert the string into a double
}
catch(Exception e)
{
if(AllowErMsg)
{
Console.Writ testtesttesreturn ttesttesttest;
else
{
//if the user's number is out of range
if()
Console.WriteLine("That number is outside the program's operational parameters. The range of acceptable input is: {0} - {1}.\nDefaulting to {2}.", lower.ToString(), upper.ToString(), def.ToString());
return //exit with default result
}
}
else /*the OK range is outside lower to upper
{
if((test < lower) || (test > upper)) //if user outside the EXclusion zone 
retu
//if the user's number is out of range
if(AllowErrMsg)
Console.WriteLine("That number is outside the program's operational parameters. The range of illegal input is: {0} - {1}.\nDefaulting to {2}.", upper.ToString(), lower.ToString(), def.ToString());
return def; */exit with default result
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|