CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2000
    Posts
    163

    Working with Strings

    Hello

    I wrote program that work with Strings.
    I read files (text files) to String variable and make some exams on that string.
    The exams pass over the string.
    I use VB method to handle the string (Like InStr, Mid$, Left$ etc.).

    The problem is when I read big files, The exams take lot of time. Some times even 10 minute to one file !!! (and My PC is good one and fast).

    There Is any way to handle with String faster ???

    Thanks for any help.


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Working with Strings

    If there's one thing VB isn't good it, it must be handeling large strings. The thing you can do is try to process stings in small parts (like if you have a string of 1000 length, parse it 10 times using strings of 100 length)
    Also, (I noticed you already doing that) use the mid$ functions in stead of Mid, all thos $ functions return strings, the ones without the $ return variants, which are slower than strings.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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

Featured