Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Help

Help

Scheduled Pinned Locked Moved C#
data-structuresregexhelp
10 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Angelinna
    wrote on last edited by
    #1

    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();

    M Z B L 4 Replies Last reply
    0
    • A Angelinna

      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();

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • A Angelinna

        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();

        Z Offline
        Z Offline
        zafersavas
        wrote on last edited by
        #3

        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 this find() function does; it is just a while loop, looping till the end of the queue and it returns when end of the queue is obtained. So it returns null.

        A 1 Reply Last reply
        0
        • A Angelinna

          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();

          B Offline
          B Offline
          Blue_Boy
          wrote on last edited by
          #4

          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.

          A 1 Reply Last reply
          0
          • Z zafersavas

            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 this find() function does; it is just a while loop, looping till the end of the queue and it returns when end of the queue is obtained. So it returns null.

            A Offline
            A Offline
            Angelinna
            wrote on last edited by
            #5

            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

            realJSOPR 1 Reply Last reply
            0
            • B Blue_Boy

              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.

              A Offline
              A Offline
              Angelinna
              wrote on last edited by
              #6

              As in my immediate response to Zafersava above.

              1 Reply Last reply
              0
              • A Angelinna

                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

                realJSOPR Offline
                realJSOPR Offline
                realJSOP
                wrote on last edited by
                #7

                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

                P 1 Reply Last reply
                0
                • realJSOPR realJSOP

                  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

                  P Offline
                  P Offline
                  Paul Conrad
                  wrote on last edited by
                  #8

                  I 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

                  1 Reply Last reply
                  0
                  • A Angelinna

                    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();

                    L Offline
                    L Offline
                    leppie
                    wrote on last edited by
                    #9

                    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)

                    A 1 Reply Last reply
                    0
                    • L leppie

                      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)

                      A Offline
                      A Offline
                      Angelinna
                      wrote on last edited by
                      #10

                      Thanks for these websites. cheers

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups