Results 1 to 5 of 5

Thread: How to Search in A txt file?

  1. #1

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    Question How to Search in A txt file?

    Hi all, got any idea of Search for a Phrase in a file? Perhaps a sentence?

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  2. #2
    Megatron
    Guest
    VB Code:
    1. Dim sText As String
    2.    
    3.     'Open the file into a string
    4.     Open "MyFile.txt" For Input As #1
    5.     sText = Input(LOF(1), 1)
    6.     Close #1
    7.    
    8.     'Search the string
    9.     If InStr(1, sText, "My Sentence") <> 0 Then MsgBox "Sentence found"

  3. #3

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    Wink Thanks superman:)

    Thank you very much bro. do You know how old I am?

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  4. #4

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    Wink How to make FOcus?

    How do you like Make your form focus?

    I tried to use me.setfocus, doesn't even work, Also
    me.show vbmodal, it does the job but it's so messy, I mean when I unload it it gets a lot of errors sometimes... Any other ways?

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  5. #5
    Megatron
    Guest
    The following are different methods (which all work fine for me):

    Show, ZOrder, SetFocus, SetActiveWindow (API), and SetForegroundWindow (API)

    What routine is the code in?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width