|
|
|
Download article
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzipto decompress it.
Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE: 1)Re-scan downloaded files using your personal virus checker before using it. 2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code. 3)Scan the source code with Minnow's Project Scanner
If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com
|
Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description. |
Other 5 submission(s) by this author
|
|
|
Report Bad Submission |
|
|
Your Vote! |
See Voting Log |
|
Other User Comments |
5/14/2002 4:15:00 PM:Chris Lucas If you take the time to read this
article, please leave your votes and
feedback. Thanks and I hope you find
this as useful as I do.
|
5/14/2002 8:32:14 PM:Bnyc77 Great code. I work in field that
relies heavily on processing millions
of lines of string data, and am always
on the lookout for an easy way to write
quick code to handle a specific need.
This is a great tool for those of us
who need string-crunching speed but
don't have time to work up a C++ app.
Cheers! Five stars for making my life
that much easier...
|
5/15/2002 6:29:31 AM:ronniec23 excellent tutorial and I can see a
million uses for this code.
|
5/15/2002 9:18:25 AM:Adam Musson Chris, this is excellent and in my
opinion is one of the best submissions
on PSC. It definitely deserves the
award. I can't wait to see your class
extending this to VB's other string
functions. I for one will use it, and
extend it if you miss any out, in my
applications. If I do any work on it
I'll send you the code. Cheers!!
|
5/15/2002 1:58:52 PM:Elias Barbosa I am impressed. I liked your submission
and your prompt response to every
request made by the other PSC members
that tried your code!
You should
work at Tech Support, some where!
:)
I just wanted to see some real
world examples. For example, could your
code be used to create a Replace
function that would work faster than
the native VB Replace Function?
You
got my best vote...
|
5/15/2002 3:38:41 PM:Charles Chadwick It's refreshing to see things posted in
the VB section that aren't "How To Use
A List Box - Vote For My Code!" and
"LeEt AoL HaCkErZ PrOgGiE!!!". This
makes me actually want to start
programming in VB again.
|
5/15/2002 9:58:36 PM:Brian Morrison Great stuff. I have been in the process
of writing an application that does a
ton of string processing, and am now
busy putting this great code to use
(already using replacements for mid,
right and left, based on this)
|
5/27/2002 2:03:50 PM:Kyle This is probably the best tool I have
encountered on the net. It saved me
mad time, and in turn allowed me to do
my job faster, which made me more
money. I'm all about more money,
Chris. 5 stars. Use this, it rocks.
|
5/29/2002 3:23:04 PM:J. B. I'd been trying to find ways to speed
up the game I've been making and this
looks like it could be useful. This
earns you 5 from me. (Not to mention
it could be useful in other apps too.)
|
8/26/2002 9:46:44 AM:tibisan MMMMMAAAANNNNNNNN!!!!! I've lost track
on this submission(erased my history,
after getting rondomly to this post),
and i've searched the site for 2
weeks(not kidding). now i finally step
here (by chance, what ironic!) to tell
u that a love this code. i'll give my
5g's from all my heart.THANK YOU!!!!!
|
9/10/2002 2:48:24 PM:Chris Lucas I've deleted a lot of your feedback in
order to keep this page a managable
size. I've noticed that this article
continues to get a large number of hits
and felt this would make things easier
on the people just finding their way to
the string revolution. Thank you all
for all the overwhelming feedback and
suggestions.
|
3/21/2003 7:17:14 AM: Loved your code. Gave you 5 globes.
Have some questions, though, regarding
your recommendations for use of this
idea with concatenation of large
strings. I have been messing around
with your ideas, but need some
assistance. Could you pass me on your
email address so that I can be more
specific in my request. I know that
you are, no doubt, busy, but I can see
the benefit already of this code for a
large database manipulation system I am
doing for my employer.
Thanks.
|
5/21/2003 4:01:00 AM: you should compare it with the string
to ByteArray method, with is the
standard in VB for fast working with
strings.
Public Function
FastWordCount2(strSample As String) As
Long
Dim i As Long, j As Long
Dim TmpB() As Byte
TmpB =
strSample ' String to bytes
For i = 0 To UBound(TmpB) Step 2
If TmpB(i) > 32 Then
FastWordCount2 = FastWordCount2 + 1
For j = i + 2 To UBound(TmpB)
Step 2
If TmpB(j) <=
32 Then Exit For
Next j
'check for code with more
than one character, double spaces,
CrLf, etc.
For j = j To
UBound(TmpB) Step 2
If
TmpB(j) > 32 Then Exit For
Next j
i = j
End
If
Next i
End
Function
However, you're method
is still 20% faster and dramaticaly
faster if the number of words is
increasing.
It is as fast as the old
PEEKL-fuction.
|
|
Add Your Feedback! |
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.
NOTICE: The author of this article has been kind enough to share it with you. If you have a criticism, please state it politely or it will be deleted.
For feedback not related to this particular article, please click here. |
|