Re: Is this a dumb way to count chars in a string?
From: MP (nospam_at_Thanks.com)
Date: 11/10/04
- Next message: Anil Bhattacharji: "Re: job avaliable in H.K. VB6, SQL programmer"
- Previous message: AFewShort: "updating an ado connectionless recordset"
- In reply to: J French: "Re: Is this a dumb way to count chars in a string?"
- Next in thread: J French: "Re: Is this a dumb way to count chars in a string?"
- Reply: J French: "Re: Is this a dumb way to count chars in a string?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Nov 2004 01:08:45 GMT
"J French" <erewhon@nowhere.uk> wrote in message
news:419086b0.7123716@news.btclick.com...
> On Mon, 08 Nov 2004 22:35:32 GMT, "MP" <nospam@Thanks.com> wrote:
>
snip
>
> Note: the use of LSet explicitly prevents String creation
very cool
:-)
>
> Also it might be an idea to check that Count is zero, if not there
> will be 'Count' unterminated opening brackets
>
> If you really want to ensure that it is running at maximum speed you
> could replace Mid$( L$, L9, 1 ) with a boxed up CopyMemory and StrPtr
> However I doubt that it would be much faster
Thanks for that example.
You taught me a new function - lset - never heard of it.
For now I've got what I'm trying to do working pretty well without counting
characters after all.
I don't know if it is inefficient but the split function is working great
for what I need it to do.
I'm guessing that split may be very inefficient since it's creating all
those individual strings and I've read several articles on vb's inefficient
string handling.
However, in my actual application it's faster than I can see so the
efficiency is theoretical at this point.
Though I've just tested with a single text file so far and the timing may
become more obvious when I start to hit a full directory of files.
Maybe I'll try a version using your counting method and try some time
trials.
Thanks to all for their insights and information on this thread.
It is much appreciated.
Mark
- Next message: Anil Bhattacharji: "Re: job avaliable in H.K. VB6, SQL programmer"
- Previous message: AFewShort: "updating an ado connectionless recordset"
- In reply to: J French: "Re: Is this a dumb way to count chars in a string?"
- Next in thread: J French: "Re: Is this a dumb way to count chars in a string?"
- Reply: J French: "Re: Is this a dumb way to count chars in a string?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|