Phil M wrote:
On Feb 28, 2005, at 12:50 PM, Ronald Vogelaar wrote:
I have created a global function which I use in stead of CountFields:
FastCountFields(txt as string, txtsep as string) as integer
Dim i, j as integer
i=0
j=instrb(txt,txtsep)
while j>0
i=i+1
j=instrb(j+1,txt,txtsep)
wend
Return i
End Function
I do not know if this is a fair comparison since the RB CountFields()
is case-insensitive. Your test is case-sensitive which would
definitely make it faster, but less flexible (if that is what you want).
We're talking countfields... how can countfields be case sensitive or
insensitive? Oh wait, hmm I guess... if txtsep was like 'a' or 'A' in a
string that contains both. Didn't think of that. No worries for me
though as I only use " " or "*" and stuff like that for separators. Then
again, it's only in RBScript that I need this, as I use the
ElfDataPlugin through out the rest of my code.
Ronald Vogelaar
http://www.rovosoft.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|