Results 1 to 6 of 6

Thread: [RESOLVED] vbTextCompare VS vbBinaryCompare

  1. #1

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Resolved [RESOLVED] vbTextCompare VS vbBinaryCompare

    I am working on a project that uses a lot of string functions and I was wondering if I should be using TextCompare or BinaryCompare and what the difference is? Is binary faster? The only thing I could find on MSDN was this:
    http://msdn.microsoft.com/library/de...concompare.asp

    I need to know which one is faster and which one is more appropriate under what circumstances. Thanks
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: vbTextCompare VS vbBinaryCompare

    vbTextCompare doesn't take Case into account. IE: "HELLO WORLD!" is the same as "hello world!", 1 uppercase, 1 lowercase. vbBinaryCompare is case sensitive, meaning "HELLO WORLD!" and "hello world!" are different.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: vbTextCompare VS vbBinaryCompare

    So there is no difference in the speed it takes to do the check? Or does anyone even know?
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: vbTextCompare VS vbBinaryCompare

    If there is a difference, it would be extremely minescule (sp?). There wouldn't be any point in worrying about the difference. If you must, why not try a loop, GetTickCount, etc. Find which one is faster?

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  5. #5

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: vbTextCompare VS vbBinaryCompare

    I knew someone would say that. Nah, I don't care that much. Just curious if anyone knew the answer off hand. chem.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  6. #6
    New Member
    Join Date
    Apr 2008
    Posts
    1

    Re: [RESOLVED] vbTextCompare VS vbBinaryCompare

    vbBinaryCompare is faster than vbTextCompare.
    This is because it just the compares the binary represenations of the two strings.

    With vbTextCompare it actually has to compare the two strings allowing for different cases (which is going to take more time).

    There are some performance figues at: http://www.aivosto.com/vbtips/stringopt2.html

    Charlie

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