G
Guest
Hi,
I'm trying to check and see if something other than numbers (either the +,
-, *, or /) are entered into a textbox, where bigR is what I call the text in
the textbox. I can get what was entered and where along the string (the
where part is the first section of below). I'm running into trouble just
after that. I tested what the value of breakpt[0] and got 3, which it should
be if entering something like 100 + 200. But when I run the for j = 0 to j
= < breakpt[0], it doesn't stop at 2, but keeps going until the index is out
of the array.
If the messagebox says breakpt[0] = 3, why doesn't j stop at 2?
Thanks!!!
Melanie
int i, j;
for(i = 0; i < bigR.Length; i++)
{
if ((bigR == '+') || (bigR == '-') || (bigR == '*') || (bigR
== '/'))
{breakpt += i;}
}
// breakpt[0] = 3 if type 100+200
MessageBox.Show(breakpt[0].ToString());
for (j = 0; j < breakpt[0]; j++)
{
MessageBox.Show(j.ToString());
nums += bigR[j];
}
I'm trying to check and see if something other than numbers (either the +,
-, *, or /) are entered into a textbox, where bigR is what I call the text in
the textbox. I can get what was entered and where along the string (the
where part is the first section of below). I'm running into trouble just
after that. I tested what the value of breakpt[0] and got 3, which it should
be if entering something like 100 + 200. But when I run the for j = 0 to j
= < breakpt[0], it doesn't stop at 2, but keeps going until the index is out
of the array.
If the messagebox says breakpt[0] = 3, why doesn't j stop at 2?
Thanks!!!
Melanie
int i, j;
for(i = 0; i < bigR.Length; i++)
{
if ((bigR == '+') || (bigR == '-') || (bigR == '*') || (bigR
== '/'))
{breakpt += i;}
}
// breakpt[0] = 3 if type 100+200
MessageBox.Show(breakpt[0].ToString());
for (j = 0; j < breakpt[0]; j++)
{
MessageBox.Show(j.ToString());
nums += bigR[j];
}