No offense at all, Mark. This is good stuff :-)
I would not have taken the time to do the timing test, since I am working on
deadlines for my business. The main reason I went through the calcs is that
I wanted to know, and the reason I did such a detailed analysis is that
others tuning in could
Message: 9
Date: Sun, 04 Dec 2005 20:02:28 -0800
From: Jim Ault <[EMAIL PROTECTED]>
Subject: Re: ANN: Remove double spaces--plugin
To: How to use Revolution
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="US-ASCII"
> It will replace doubles sp
Jim, I hope you didn't take my little experiment as some kind of one-
upmanship - it certainly wasn't intended as such.
I was simply interested to see, in this example of removing double-
spaces, how great the difference was between the more flexible regex
approach, and the more specific "repla
Ops I clicked 'send' too quickly... That should read:
Approximation:
A text block containing 1700 characters, 50% of which were spaces, would
take about
*2 milliseconds*
to use ReplaceText pattern searching,
which is 10 times slower than the Replace technique you programmed.
Jim Ault
Interesting, Mark. Good example. [see code below in original post]
So 20 milliseconds div 10,000 space runs
= 2.0 x 10^-2 seconds div 1.0 x 10^4 = 2.0 x 10^-6 seconds
0.02 seconds -->one Replace of a space run
0.20 seconds -->one ReplaceText of a space run
0.002 milliseconds -->o
'The replaceText function is not as fast as the Replace command'
That is certainly true.
in the code below, using the more complicated (in terms of code)
replace function takes 20ish milliseconds, whereas the replaceText
version (commented out) takes about 200.
on mouseUp
repeat 1
According to the dictionary:
ReplaceText function
Searches for a regular expression and replaces the portions that match the
regular expression.
The replaceText function is not as fast as the Replace command, but is more
flexible because you can search for any text that matches a regular
expressio
Stupid question: How does rev know to process that as a regex as opposed to
the literal " +"?
"Jim Ault" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> Another approach is to use :
>
> put replaceText(fld storyline," +"," ") into fld storyline
__
> It will replace doubles spaces in a text field with single spaces
> without affecting the formatting.
Another approach is to use :
put replaceText(fld storyline," +"," ") into fld storyline
which is the regular expression that replaces all runs of spaces with a
single space. The " +" says 'on
Maybe it's just me. Maybe I have a heavy thumb, but I always get a
number of multiple spaces in my text.
(Witness the above line.)
Hence the following VERY simple plugin--in the message box:
go stack url "http://home.infostations.net/jhurley/RemoveDoubles.rev";
It will replace doubles spa
10 matches
Mail list logo