How to remove repeating spaces

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

How to remove repeating spaces

Bill Vlahos
I want to remove repeating spaces in a field. I can write a brute  
force method but before I do that I'd like to see if someone has  
already invented this wheel.

Basically all I want to do is reduce all multiple instances of spaces  
in a field to a single space. There could be double, triple, or more  
spaces together and I want to reduce them all to just one.

I can think of a repeating loop that replaces two spaces with one and  
just do it until there aren't any more or do a series of replaces four  
spaces with one, then three spaces with one, then two spaces with one  
but neither of these seem very elegant.

Bill Vlahos
_________________
InfoWallet (http://www.infowallet.com) helps me remember the important  
details of my life.

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: How to remove repeating spaces

xtalkprogrammer
Bill:

put replacetext(fld "Spaces","[ ]+"," ") into fld "Spaces"

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer

Download Strõm Flow Chart Software
http://flowproject.economy-x-talk.com

On 3 nov 2009, at 00:51, Bill Vlahos wrote:

> I want to remove repeating spaces in a field. I can write a brute  
> force method but before I do that I'd like to see if someone has  
> already invented this wheel.
>
> Basically all I want to do is reduce all multiple instances of  
> spaces in a field to a single space. There could be double, triple,  
> or more spaces together and I want to reduce them all to just one.
>
> I can think of a repeating loop that replaces two spaces with one  
> and just do it until there aren't any more or do a series of  
> replaces four spaces with one, then three spaces with one, then two  
> spaces with one but neither of these seem very elegant.
>
> Bill Vlahos


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553
Reply | Threaded
Open this post in threaded view
|

Re: How to remove repeating spaces

Jim Ault
On Nov 2, 2009, at 3:54 PM, Mark Schonewille wrote:

> Bill:
> put replacetext(fld "Spaces","[ ]+"," ") into fld "Spaces"
>
> Mark Schonewille
>
> On 3 nov 2009, at 00:51, Bill Vlahos wrote:
>
>> I want to remove repeating spaces in a field. I can write a brute  
>> force method but before I do that I'd like to see if someone has  
>> already invented this wheel.
>>
>> Basically all I want to do is reduce all multiple instances of  
>> spaces in a field to a single space. There could be double, triple,  
>> or more spaces together and I want to reduce them all to just one.
>>
>> I can think of a repeating loop that replaces two spaces with one  
>> and just do it until there aren't any more or do a series of  
>> replaces four spaces with one, then three spaces with one, then two  
>> spaces with one but neither of these seem very elegant.
>>
>> Bill Vlahos


Additionally if you want to remove (trim) single spaces from either  
side of each line you could add

get fld "Spaces"
repeat for each line LNN in IT
    put word 1 to -1 of LNN & cr after newLines
end repeat
put replacetext( char 1 to -2 of newLines ,"[ ]+"," ") into fld "Spaces"


Hope this helps,

Jim Ault
Las Vegas
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: How to remove repeating spaces

Bill Vlahos
Mark and Jim,

Awesome. I knew there had to be an elegant way to do this.

Thank you,
Bill Vlahos

On Nov 2, 2009, at 4:20 PM, Jim Ault wrote:

> On Nov 2, 2009, at 3:54 PM, Mark Schonewille wrote:
>
>> Bill:
>> put replacetext(fld "Spaces","[ ]+"," ") into fld "Spaces"
>>
>> Mark Schonewille
>>
>> On 3 nov 2009, at 00:51, Bill Vlahos wrote:
>>
>>> I want to remove repeating spaces in a field. I can write a brute  
>>> force method but before I do that I'd like to see if someone has  
>>> already invented this wheel.
>>>
>>> Basically all I want to do is reduce all multiple instances of  
>>> spaces in a field to a single space. There could be double,  
>>> triple, or more spaces together and I want to reduce them all to  
>>> just one.
>>>
>>> I can think of a repeating loop that replaces two spaces with one  
>>> and just do it until there aren't any more or do a series of  
>>> replaces four spaces with one, then three spaces with one, then  
>>> two spaces with one but neither of these seem very elegant.
>>>
>>> Bill Vlahos
>
>
> Additionally if you want to remove (trim) single spaces from either  
> side of each line you could add
>
> get fld "Spaces"
> repeat for each line LNN in IT
>   put word 1 to -1 of LNN & cr after newLines
> end repeat
> put replacetext( char 1 to -2 of newLines ,"[ ]+"," ") into fld  
> "Spaces"
>
>
> Hope this helps,
>
> Jim Ault
> Las Vegas
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

Bill Vlahos
_________________
InfoWallet (http://www.infowallet.com) helps me remember the important  
details of my life.

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Buttons on revlets need "priming" before they work?

Bruce Pokras
In reply to this post by Jim Ault
I have noticed in a couple of instances that revlet buttons would not  
work until I did something else. For example, the "revWeb Security  
Helper" buttons would not work until I dragged it and then clicked  
the buttons. Also, buttons on my patent family revlet, Family-izer  
(http://www.blazingdawn.com/demo/family-izer.html) would sometimes  
not work until I clicked outside of the revlet.

I am on an iMac running 10.4.11. Has anyone else experienced this  
kind of weirdness?

Regards,

Bruce Pokras

Blazing Dawn Software
www.blazingdawn.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Buttons on revlets need "priming" before they work?

Marc Siskin
Bruce,

Do you notice this more with Firefox or is it in both FF and Safari?  I have a simple stack that I can't click on some buttons when running the stack in FF.  I reported it to Support but I haven't heard from them about it.

Marc Siskin


On Nov 13, 2009, at 4:09 PM, Bruce Pokras wrote:

> I have noticed in a couple of instances that revlet buttons would not work until I did something else. For example, the "revWeb Security Helper" buttons would not work until I dragged it and then clicked the buttons. Also, buttons on my patent family revlet, Family-izer (http://www.blazingdawn.com/demo/family-izer.html) would sometimes not work until I clicked outside of the revlet.
>
> I am on an iMac running 10.4.11. Has anyone else experienced this kind of weirdness?
>
> Regards,
>
> Bruce Pokras
>
> Blazing Dawn Software
> www.blazingdawn.com
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

---------------
Marc Siskin
Manager, Modern Language Resource Center
Carnegie Mellon University
[hidden email]



_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Buttons on revlets need "priming" before they work?

Dom-2
In reply to this post by Bruce Pokras
Bruce Pokras <[hidden email]> wrote:

> I am on an iMac running 10.4.11. Has anyone else experienced this  
> kind of weirdness?

Yes. I have a simple demo revlet, which gives the current date upon
clicking a button. Actually it worked as you describe after a little
fiddling around.

Just tested now at:

http://medard.on-rev.com/RevWeb/hello/test.html

I must click outside the revlet, then the click on the button functions

iMac G5, Mac OS X 10.5.7
-- so, not a Tiger problem ;-)


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Buttons on revlets need "priming" before they work?

François Chaplais-3

Le 13 nov. 2009 à 23:17, Dom a écrit :

> Bruce Pokras <[hidden email]> wrote:
>
>> I am on an iMac running 10.4.11. Has anyone else experienced this  
>> kind of weirdness?
>
> Yes. I have a simple demo revlet, which gives the current date upon
> clicking a button. Actually it worked as you describe after a little
> fiddling around.
>
> Just tested now at:
>
> http://medard.on-rev.com/RevWeb/hello/test.html
>
> I must click outside the revlet, then the click on the button functions
>
> iMac G5, Mac OS X 10.5.7
> -- so, not a Tiger problem ;-)
>

works fine on latest( safari + snow leopard + plugin)

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Buttons on revlets need "priming" before they work?

Terry Judd
In reply to this post by Bruce Pokras
Hi Bruce - I had the same issue during some limited testing with the web
plugin the other day. The buttons in the security window were unresponsive
to clicks until you moved the window. Mac OS 10.5.8

Sounds like it's worth putting in a bug report.

Terry...

On 14/11/09 8:09 AM, "Bruce Pokras" <[hidden email]> wrote:

> I have noticed in a couple of instances that revlet buttons would not
> work until I did something else. For example, the "revWeb Security
> Helper" buttons would not work until I dragged it and then clicked
> the buttons. Also, buttons on my patent family revlet, Family-izer
> (http://www.blazingdawn.com/demo/family-izer.html) would sometimes
> not work until I clicked outside of the revlet.
>
> I am on an iMac running 10.4.11. Has anyone else experienced this
> kind of weirdness?
>
> Regards,
>
> Bruce Pokras
>
> Blazing Dawn Software
> www.blazingdawn.com
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution