Welcome Guest
Log In | Register )
You last visited December 4, 2016, 9:15 am
All times shown are
Eastern Time (GMT-5:00)

Parsing

Topic closed. 91 replies. Last post 12 years ago by Sedertree.

Page 1 of 7
PrintE-mailLink
Avatar
East Jordan, MI
United States
Member #2
June 1, 2001
675 Posts
Offline
Posted: January 7, 2005, 3:04 am - IP Logged

Hello Fellow Programmers,



Need some help with handling strings.



I need to parse every nth character from a string/textbox control in Visual Basic.



Any suggestions or links?

    Avatar
    Belleville , Illinois
    United States
    Member #1850
    July 15, 2003
    70 Posts
    Offline
    Posted: January 7, 2005, 4:41 am - IP Logged

    While looking for programmers I would like a routine that will count the pairs from an output of lotto632 and or lotwon to see what pairs or triples of numbers were generated by these programs for 5/ 39 and or 6/52 games , to this end we could see if a given set of two or three is most likely to hit sets could be used in a wheeling program.



    BigJer

      Todd's avatar - Cylon 2.gif
      Chief Bottle Washer
      New Jersey
      United States
      Member #1
      May 31, 2000
      23260 Posts
      Online
      Posted: January 7, 2005, 6:32 am - IP Logged
      Quote: Originally posted by Sedertree on January 7, 2005


      Hello Fellow Programmers,

      Need some help with handling strings.

      I need to parse every nth character from a string/textbox control in Visual Basic.

      Any suggestions or links?



      To parse every 5th character of strString:

      for x = 1 to len(strString) step 5
        strChar = mid(strString, x, 1)
        'Do whatever with strChar
      next

      (Or change the x = 1 to x = 5 to start at the 5th character instead of the first character.)

       

      Check the State Lottery Report Card
      What grade did your lottery earn?

       

      Sign the Petition for True Lottery Drawings
      Help eliminate computerized drawings!

        Johnny5's avatar - japheth
        Ocala
        United States
        Member #3015
        December 13, 2003
        70 Posts
        Offline
        Posted: January 7, 2005, 3:58 pm - IP Logged

        Good work Todd.



        I would though make sure he knows to capture information in the "Text Box" in VB.



        It will look similar but like this:



        strString = this.text1.value



        for x = 1 to len(strString) step 5

        strChar = mid(strString, x, 1)

        'Do whatever with strChar

        next



        If you have a variable without value it won't work. Unless you specify the "this.text1.value" in place of the "strString" variable.



        Anyway, Todd gave you the base of the code. I just wanted to add in case you forget to assign the value.



        Hey it can happen to anyone.



        Laters and good luck.

        To play is not to win, but to win keeps you playing..       

          Avatar
          East Jordan, MI
          United States
          Member #2
          June 1, 2001
          675 Posts
          Offline
          Posted: January 7, 2005, 6:37 pm - IP Logged

          Thanks Guys,

          I haven't put this specific code to work yet.  The "all positions" digit tabulator code I finished this morning for the position frequencies has swollen my app to 1.14MB.  Oh well, at least I'm generating the bar graph array now.

          I've had to start compiling in safe mode just to cut the time down to 5 minutes.  I'll probably start parsing specific positions this weekend.  I'll put up a screenshot when I finish this phase of programming.

            Todd's avatar - Cylon 2.gif
            Chief Bottle Washer
            New Jersey
            United States
            Member #1
            May 31, 2000
            23260 Posts
            Online
            Posted: January 7, 2005, 6:50 pm - IP Logged
            Quote: Originally posted by Johnny5 on January 7, 2005


            Good work Todd.

            I would though make sure he knows to capture information in the "Text Box" in VB.

            It will look similar but like this:

            strString = this.text1.value

            for x = 1 to len(strString) step 5
            strChar = mid(strString, x, 1)
            'Do whatever with strChar
            next

            If you have a variable without value it won't work. Unless you specify the "this.text1.value" in place of the "strString" variable.

            Anyway, Todd gave you the base of the code. I just wanted to add in case you forget to assign the value.

            Hey it can happen to anyone.

            Laters and good luck.



            I kinda figured he would know to put a value in the string variable.  It was just a code fragment.

             

            Check the State Lottery Report Card
            What grade did your lottery earn?

             

            Sign the Petition for True Lottery Drawings
            Help eliminate computerized drawings!

              JADELottery's avatar - MeAtWork 03.PNG
              The Quantum Master
              West Concord, MN
              United States
              Member #21
              December 7, 2001
              3675 Posts
              Offline
              Posted: January 7, 2005, 7:01 pm - IP Logged

              Todd, he's the man. If he can't code it, no one can.

              Presented 'AS IS' and for Entertainment Purposes Only.
              Any gain or loss is your responsibility.
              Use at your own risk.

              Order is a Subset of Chaos
              Knowledge is Beyond Belief
              Wisdom is Not Censored
              Douglas Paul Smallish
              Jehocifer

                Avatar
                East Jordan, MI
                United States
                Member #2
                June 1, 2001
                675 Posts
                Offline
                Posted: January 7, 2005, 8:09 pm - IP Logged

                Yea,

                I knew about .value, but good looking out.  And thanks for the footnotes about the variable values for x.  I'm sure that would have been my next question when the code wouldn't recognize the digits in the first and/or second numbers of the string.

                Forgot to post that last part earlier, was in a hurry....

                  Avatar
                  East Jordan, MI
                  United States
                  Member #2
                  June 1, 2001
                  675 Posts
                  Offline
                  Posted: January 8, 2005, 4:22 am - IP Logged

                  Forgot that I don't need Val(text1.text) because I have a user-defined function that handles the digits as integers. Which generates the frequency chart(graphics array). Anyway the code is working as;

                          Dim digitString As String

                          Dim strChar As String



                  Private Sub FourthPosit4_Click()

                          digitString = Text1.Text   '(String of winning numbers)

                         

                          For x = 4 To Len(digitString) Step 5

                          strChar = Mid(digitString, x, 1)

                          'Add strChar to Digit Textbox String

                          Text3.Text = Text3.Text + strChar '(String of parsed digits)

                  Next x



                  This sub is parsing the fourth digit from a delimited string of past winning Pick-4 numbers and putting them together into text3.text



                  Thanks again for your help. I'll post a screenshot after I get these specific positions to generate (.visible) the graphic array. Right now the "All Positions" click dvent is the only one doing this.

                    Avatar
                    East Jordan, MI
                    United States
                    Member #2
                    June 1, 2001
                    675 Posts
                    Offline
                    Posted: January 8, 2005, 12:25 pm - IP Logged
                      retxx's avatar - mrthumbs
                      BOSTON
                      United States
                      Member #48
                      September 9, 2001
                      3584 Posts
                      Offline
                      Posted: January 8, 2005, 9:50 pm - IP Logged

                      hi will you allow us to try it out in our own states when it is ready? Thanks

                        LANTERN's avatar - kilroy 28_173_reasonably_small.jpg
                        Tx
                        United States
                        Member #4570
                        May 4, 2004
                        5180 Posts
                        Offline
                        Posted: January 8, 2005, 10:00 pm - IP Logged

                        So it seems that you are working on a new better version of your Wheeling system.

                        That's very good.

                        Good luck.

                         

                        BibleOnline  ParishesOnline  ChristianRadioOnline   MassOnline   Mass

                        "Ten measures of beauty descended to the world, nine were taken by Jerusalem."

                          Avatar
                          East Jordan, MI
                          United States
                          Member #2
                          June 1, 2001
                          675 Posts
                          Offline
                          Posted: January 9, 2005, 1:24 am - IP Logged

                          Retxx,



                          Yes.... As you can see, it is DonationWare. I'm sure there will be some "software freeloaders" out there. But I'm hoping some people will enjoy it enough to reward me for my time and for making them some money.



                          Lantern,



                          The Distribution Chart shown in the screenshot is fully interactive and easy to understand. A major improvement over the freeware version. The "Actual" and "Sorted" buttons have not been coded yet. You might be asking yourself "Why the buttons?" I don't want to give the secret away just yet.



                          I'm breathing a sigh of relief since the chart was a major undertaking. Did it all myself with a little help from my friends in the tough spots.



                          Back to work....

                            Sandy K's avatar - graphic pub.jpg
                            Clarkston, Michigan
                            United States
                            Member #76
                            January 6, 2002
                            8528 Posts
                            Offline
                            Posted: January 12, 2005, 6:57 am - IP Logged

                            George, are you going to fix that .ocx file thing?  Too confusing how to fix...I deleted the whole thing because I ain't fussing!!

                            Sandy

                              retxx's avatar - mrthumbs
                              BOSTON
                              United States
                              Member #48
                              September 9, 2001
                              3584 Posts
                              Offline
                              Posted: January 13, 2005, 11:16 am - IP Logged

                              george,are you saying that you released it? If so where?Thanks