By George I have got it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    By George I have got it

    To aid in our new finding, let us bring in Bram Stockers Dracula "1992", scene with Keanu Reeves and Gary Oldman:

    Text with single and double Hard returns:

    should leave this room and go to any other parts of the castle
    it is owned and holds many bad memories

    Be warned

    Code:
    Dim P As Long
         Dim s1 As String
         s1 = Text6(0).Text
         s1 = Replace(Replace(Replace(s1, vbNewLine & vbNewLine, _
         vbNullString), vbNewLine, vbNullString), vbNullString, vbNewLine)
         Text6(0).Text = s1
      
    P = WordFoundInText(Text3.Text, Text6(0).Text)
      If P Then
        Text1.Text = "True"
        Text2.Text = Text3.Text
      Else
        
        Text6(0).SetFocus
        Text6(0).SelLength = Len(Text3.Text)
        Text1.Text = "Darn!"
        Text2.Text = "What?"
      End If
    Here is the output, Killer:

    should leave this room and go to any other parts of the castle it is owned and holds many bad memories Be warned

    Killer, if I did not thank you yet, you're are the best :-)

    Boy, I've learned so much here, my professor will be happy to hear about this, should also relay to Steve.

    By the way, good buddies, check out Avisto, I do not know why I am telling you this, you guys are experts already; just spreading the good word.

    I found out many ways to make our code faster through this site. vbNullString as opposed to " ", vbBinaryCompare , instead of vbTextCompare, vbNewLine, in the place of vbCrLF, and/or its twins.

    Barring any unforeseen adventures with parenting or the code I should have more than enough time to complete this project, now 20% done.

    In a bit, Killer, and good people of our good, good VB forum. Will post a "dictionary program" here, a language translator really for other Newbies :-)

    Dököll
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    vbNewLine is not 'faster' than vbCrLf. vbNewLine is platform specific. Sometimes it is 13 and 10 sometimes it is just 10. vbCrLf is always 13 & 10. They are constants and not functions so there is not a speed issue as they are replaced by the compiler.

    vbBinaryCompare , instead of vbTextCompare
    this is not a choice of speed but one of logic. vbBinaryCompare is case sensitive, vbTextCompare is not

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Glad to help. I'd just like to say the following...
      • Being labelled an "expert" is pretty meaningless, really. Everybody who comes to the site has different skills in different areas.
      • Unless you're dealing with huge volumes of data, I doubt the speed will ever be an issue.
      • I certainly can't take sole credit for helping you along - I'm sure willakawill and others have put in heaps of effort.
      • What the heck is Avisto?

      Comment

      • Dököll
        Recognized Expert Top Contributor
        • Nov 2006
        • 2379

        #4
        Point taken, and again, I am still learning...

        Still think you guys are experts; only attempting to show respect to those who know a lot more than I do about VB. Wife thinks I am a smarty, told her to read this group...She's very supportive. Nevertheless, I am with you on his one Killer, different skills for different folks.

        And you could be right as well there Will, the site I am read this from could be also be right, as I am right in the middle...I just take it all in and learn: http://www.aivosto.com/vbtips/stringopt.html. Please excuse the typo, Killer, it's Aivosto, check it out. Should have added this previously for all to see.

        Anyway, I was coming here to report "No Problems", should sometimes report I am doing well, still have the muscle, played a lot more with the boys, and I have managed to sleep well last night :-)

        Killer, Will, VB fans, I have massive amounts of if statements to deal with. One reason why, I was happy to report Aivosto as one site to check out. It, and the the friendly reminder to use LCase (pointed out the RollingStone fella, no names need mentioned) have helped reduce data calls. No longer have to add Rain and rain to make sure I get it all.

        Now I did not know, BinaryCompare was case sensitive, must watch out for that, thanks ;-)

        Look, I've written too much, Again. All is well, as said, my friends, no deal-breakers, except our 93 s Turbo Saab's defroger/defroster does not work this morning (too much ice on the windshield), would be nice if there was a code for that :-)

        Should be able to say hello soon and again...

        Dököll

        Comment

        • Dököll
          Recognized Expert Top Contributor
          • Nov 2006
          • 2379

          #5
          Speed is not an issue, you were right...The application will not pick up all words at once. In some instances, 3 or 4 words will be found, further testing proved speed is only an issue when duringn testing I add all words that must be collected, thus, all Textboxes are filled, takes merely 5 seconds per frame...

          Comment

          Working...