Help
-
I wonder where Iam going wrong with these codes; // form1.cs private void matchbutton_Click(object sender, EventArgs e) { string TagNum; TagNum = InputBox.Text; string dataqueue; dataqueue = myRecord.find(); if( TagNum == myRecord.find()) { OutputBox.AppendText(" Match"); //InputBox.Clear(); } else { OutputBox.AppendText("No Match"); .............................................................. // queue.cs public Boolean contains() { return (find() != null); } public string find() { queuedata current = first; while(current !=null && !current.GetType().Equals(this)) current = current.nextdata; return current.ToString();
-
I wonder where Iam going wrong with these codes; // form1.cs private void matchbutton_Click(object sender, EventArgs e) { string TagNum; TagNum = InputBox.Text; string dataqueue; dataqueue = myRecord.find(); if( TagNum == myRecord.find()) { OutputBox.AppendText(" Match"); //InputBox.Clear(); } else { OutputBox.AppendText("No Match"); .............................................................. // queue.cs public Boolean contains() { return (find() != null); } public string find() { queuedata current = first; while(current !=null && !current.GetType().Equals(this)) current = current.nextdata; return current.ToString();
Angelinna wrote:
I wonder where Iam going wrong with these codes;
Do you think that we are gonna get a dream of problem. Atleast, explain where and what problem you are facing...
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
I wonder where Iam going wrong with these codes; // form1.cs private void matchbutton_Click(object sender, EventArgs e) { string TagNum; TagNum = InputBox.Text; string dataqueue; dataqueue = myRecord.find(); if( TagNum == myRecord.find()) { OutputBox.AppendText(" Match"); //InputBox.Clear(); } else { OutputBox.AppendText("No Match"); .............................................................. // queue.cs public Boolean contains() { return (find() != null); } public string find() { queuedata current = first; while(current !=null && !current.GetType().Equals(this)) current = current.nextdata; return current.ToString();
First of all you should tell us what the code is expected to do and what are the errors you are getting when you run it. I think you are trying to search for a string in a queue with the code
if( TagNum == myRecord.find())
. ok lets see what thisfind()
function does; it is just awhile
loop, looping till the end of the queue and it returns when end of the queue is obtained. So it returnsnull
. -
I wonder where Iam going wrong with these codes; // form1.cs private void matchbutton_Click(object sender, EventArgs e) { string TagNum; TagNum = InputBox.Text; string dataqueue; dataqueue = myRecord.find(); if( TagNum == myRecord.find()) { OutputBox.AppendText(" Match"); //InputBox.Clear(); } else { OutputBox.AppendText("No Match"); .............................................................. // queue.cs public Boolean contains() { return (find() != null); } public string find() { queuedata current = first; while(current !=null && !current.GetType().Equals(this)) current = current.nextdata; return current.ToString();
-
First of all you should tell us what the code is expected to do and what are the errors you are getting when you run it. I think you are trying to search for a string in a queue with the code
if( TagNum == myRecord.find())
. ok lets see what thisfind()
function does; it is just awhile
loop, looping till the end of the queue and it returns when end of the queue is obtained. So it returnsnull
.Certainly. I am trying to search for a number in the queue such that if I put that number in a textbox, and click on a match button, a search takes place. If the number is found to be present, then I get a message in my output(a richtextbox) box that the number is indeed present and if not present, I get a message in my output box that the number is actually not among those in the queue. Thanks
modified on Saturday, September 6, 2008 6:38 AM
-
What is wrong in your code?
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
-
Certainly. I am trying to search for a number in the queue such that if I put that number in a textbox, and click on a match button, a search takes place. If the number is found to be present, then I get a message in my output(a richtextbox) box that the number is indeed present and if not present, I get a message in my output box that the number is actually not among those in the queue. Thanks
modified on Saturday, September 6, 2008 6:38 AM
Were you aware that Visual Studio comes with a very capable debugger?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Were you aware that Visual Studio comes with a very capable debugger?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001I second that. It is amazing how many people I meet, who are unaware of how capable Visual Studio's debugger. I mean, how hard is it to press F9 on suspect lines of code, and run the damn thing?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
-
I wonder where Iam going wrong with these codes; // form1.cs private void matchbutton_Click(object sender, EventArgs e) { string TagNum; TagNum = InputBox.Text; string dataqueue; dataqueue = myRecord.find(); if( TagNum == myRecord.find()) { OutputBox.AppendText(" Match"); //InputBox.Clear(); } else { OutputBox.AppendText("No Match"); .............................................................. // queue.cs public Boolean contains() { return (find() != null); } public string find() { queuedata current = first; while(current !=null && !current.GetType().Equals(this)) current = current.nextdata; return current.ToString();
-
Angelinna wrote:
current.GetType().Equals(this)
For starters, that can NEVER be true.
xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 4a out now (29 May 2008)