Re: ANN: Remove double spaces--plugin

2005-12-05 Thread Jim Ault
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

Re: ANN: Remove double spaces--plugin

2005-12-05 Thread Jim Hurley
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

Re: ANN: Remove double spaces--plugin

2005-12-05 Thread Mark Smith
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

Re: ANN: Remove double spaces--plugin

2005-12-05 Thread Jim Ault
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

Re: ANN: Remove double spaces--plugin

2005-12-05 Thread 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

Re: ANN: Remove double spaces--plugin

2005-12-04 Thread Mark Smith
'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

Re: ANN: Remove double spaces--plugin

2005-12-04 Thread Jim Ault
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

Re: ANN: Remove double spaces--plugin

2005-12-04 Thread Bill Marriott
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 __

Re: ANN: Remove double spaces--plugin

2005-12-04 Thread Jim Ault
> 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

ANN: Remove double spaces--plugin

2005-12-04 Thread Jim Hurley
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