Results 1 to 3 of 3

Thread: [RESOLVED] Parsing data, which is better??

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2013
    Posts
    24

    Resolved [RESOLVED] Parsing data, which is better??

    Hello guys,

    You who have years of experience, how do you think? Which built-in function is fast performing? Mid, or Instr? Because Sometimes we are able to use both of them to parse some Data. I used for my project both of them. Maybe I'm wrong but Instr seems to be slower? I'm talking when you're getting data to be parsed from the network. Maybe there is a difference between local file manipulation and remote file manipulation? Just wanted to know what people think about it?

    Much appreciated your time to answer this question,which will help us (to newbies) growing and getting more and more experience.

    Thanks in advance!

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: Parsing data, which is better??

    Short answer: In general, InStr will be faster than Mid$, simply because InStr searches the string while Mid$ creates a new string.

    Detailed answer: Read the following articles from Aivosto to get a better understanding:

    Optimize string handling in VB6 - Part I

    Optimize string handling in VB6 - Part II

    Optimize string handling in VB6 - Part III

    VB InStr
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2013
    Posts
    24

    Re: Parsing data, which is better??

    Great articles! Reading them Thanks a lot!

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