Click here to Skip to main content
15,905,508 members
Home / Discussions / C#
   

C#

 
GeneralRe: Argument Pin
BabyOreo27-Apr-09 23:05
BabyOreo27-Apr-09 23:05 
GeneralRe: Argument Pin
musefan27-Apr-09 23:47
musefan27-Apr-09 23:47 
GeneralRe: Argument Pin
BabyOreo27-Apr-09 23:52
BabyOreo27-Apr-09 23:52 
GeneralRe: Argument Pin
musefan28-Apr-09 0:45
musefan28-Apr-09 0:45 
AnswerRe: Argument Pin
SeMartens27-Apr-09 22:08
SeMartens27-Apr-09 22:08 
AnswerRe: Argument Pin
N a v a n e e t h27-Apr-09 22:35
N a v a n e e t h27-Apr-09 22:35 
AnswerRe: Argument Pin
12Code27-Apr-09 23:07
12Code27-Apr-09 23:07 
GeneralRe: Argument Pin
BabyOreo27-Apr-09 23:13
BabyOreo27-Apr-09 23:13 
what if i wan to test the following function?

private void btnAddEntry_Click(object sender, EventArgs e)
{
double gas, miles;
int i;
string d;
char c;
bool validDate;
// Validate date format (actual values not checked)
// strip out any spaces
d = "";
for (i = 0; i < txtDate.Text.Length; i++)
{
if (txtDate.Text.Substring(i, 1) != " ")
{
d += txtDate.Text.Substring(i, 1);
}
}
txtDate.Text = d;
validDate = true;
// make sure date has eight characters (two are slashes remainder are numbers)
if (txtDate.Text.Length != 8)
{
validDate = false;
}
else
{
for (i = 0; i < 8; i++)
{
c = Convert.ToChar(txtDate.Text.Substring(i, 1));
if (i == 2 || i == 5)
{
if (c != '/')
{
validDate = false;
}
}
else
{
if (c < '0' || c > '9')
{
validDate = false;
}
}
}
}
if (!validDate)
{
MessageBox.Show("Date must be in form mm/dd/yy", "Date Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
txtDate.Focus();
return;
}
// Make sure miles is greater than previous value
miles = Convert.ToDouble(txtMiles.Text);
if (numValues > 0)
{
if (miles <= odometer[numValues - 1])
{
MessageBox.Show("Odometer reading less than previous value.", "Odometer Reading Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
txtMiles.Focus();
return;
}
}
// No zero gallons allowed
gas = Convert.ToDouble(txtGallons.Text);
if (gas <= 0)
{
MessageBox.Show("Gallons pumped must be greater than zero", "Gallons Pumped Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
txtGallons.Focus();
return;
}
dates[numValues] = txtDate.Text;
odometer[numValues] = miles;
gallons[numValues] = gas;
numValues++;
NewEntryLine();
txtDate.Text = GetToday();
txtMiles.Text = "";
txtGallons.Text = "";
txtDate.Focus();
}
GeneralRe: Argument Pin
Luc Pattyn28-Apr-09 1:10
sitebuilderLuc Pattyn28-Apr-09 1:10 
AnswerRe: Argument [modified] Pin
DaveyM6927-Apr-09 23:13
professionalDaveyM6927-Apr-09 23:13 
QuestionSomething with a delegate Pin
Joramq27-Apr-09 21:51
Joramq27-Apr-09 21:51 
AnswerRe: Something with a delegate Pin
Christian Graus27-Apr-09 22:07
protectorChristian Graus27-Apr-09 22:07 
GeneralRe: Something with a delegate Pin
Joramq27-Apr-09 22:10
Joramq27-Apr-09 22:10 
AnswerRe: Something with a delegate Pin
OriginalGriff27-Apr-09 22:10
mveOriginalGriff27-Apr-09 22:10 
AnswerRe: Something with a delegate Pin
N a v a n e e t h27-Apr-09 22:38
N a v a n e e t h27-Apr-09 22:38 
GeneralRe: Something with a delegate Pin
Joramq27-Apr-09 23:09
Joramq27-Apr-09 23:09 
GeneralRe: Something with a delegate Pin
N a v a n e e t h28-Apr-09 0:09
N a v a n e e t h28-Apr-09 0:09 
GeneralRe: Something with a delegate Pin
Joramq28-Apr-09 0:17
Joramq28-Apr-09 0:17 
GeneralRe: Something with a delegate Pin
Tom Deketelaere28-Apr-09 1:20
professionalTom Deketelaere28-Apr-09 1:20 
GeneralRe: Something with a delegate Pin
N a v a n e e t h28-Apr-09 1:59
N a v a n e e t h28-Apr-09 1:59 
AnswerRe: Something with a delegate Pin
Luc Pattyn28-Apr-09 1:17
sitebuilderLuc Pattyn28-Apr-09 1:17 
GeneralRe: Something with a delegate Pin
Joramq28-Apr-09 2:03
Joramq28-Apr-09 2:03 
Questionhow can i send mail to all the members at a once...database contains the user details and email addresses........ Pin
jiya131127-Apr-09 21:10
jiya131127-Apr-09 21:10 
AnswerRe: how can i send mail to all the members at a once...database contains the user details and email addresses........ Pin
dotnetmember27-Apr-09 21:26
dotnetmember27-Apr-09 21:26 
QuestionImage to bitmap conversion error...again! Pin
sebogawa27-Apr-09 21:02
sebogawa27-Apr-09 21:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.