Re: getting rid of multiple consecutive blanks ?

John Markley <[email protected]> Mon, 09 Nov 2009 09:07:28 -0500
Newsgroups gmane.comp.handhelds.palm.peditors
Message-ID <[email protected]>
Quoting Voytek Eymont <[email protected]>:

> thanks, John.

You are welcome.  I love doing this stuff.

> I'll test leading space deleter later, I've also kept the original
> (renamed) SPdelete.

You can run LeadingSpaceDelete by itself to test it if you wish.  If  
you put the first few letters of "LeadingSpaceDelete" in the pScript  
starter dialog it will run without having SPdelete run first.
*But*, just renaming the first pScript in the SPdelete chain, but not  
all the linked pScripts in the chain ( SPd2, SPd3, etc) will not be  
sufficient, because you will now have *two* SPd6 pScripts, one that  
just ends, {SPd6::d}, and the other that links to LeadingSpaceDelete.   
Again, each pScript in a chain is a complete pScript on its own, and  
it doesn't matter what order they appear.  The command   
"/&script$[@@xxx@@]}" says, as the final action of this pScript, go  
find the pScript named xxx and run it.  It doesn't matter where in the  
pad the pScript named xxx resides.  The code Paul wrote into pedit and  
pToolSet to run pScripts goes to the very start of the pad and scans  
down until it finds {xxx:  and runs it.  If there is more than one  
pScript with the same name, the one nearest the top of the pad will  
always run, no matter what you intend, because that is the one that  
the program encounters first.  You could have the various SPd scripts  
scattered all over the place in your pad, not in numerical order, and  
it would run just fine.  The sequential numbering is to assist the  
user logically, not to run the chain.  So, if you now have two  
different {SPd6: pScripts, whichever is closer to the top of the pad  
is the one that will run, rgardless of your intent.  You must either  
change *all* the names in the chain, or just use "}" to stop SPd6  
after "d".  That is to say, in the modified spD6

{SPd6::d
/&script$[@@LeadingSpaceDelete@@]}

if you just put "}"  after  "d", so it reads

{SPd6::d }
/&script$[@@LeadingSpaceDelete@@]}

then you have the original SPd6, it will stop at "d" and not run /&script$....

Then you would not need a renamed SPdelete at all.


> but the set of scripts you made make a pretty good 'web page sanitizer'

Great!

     ~ John


------------------------------------

Latest pedit/pToolSet/LapTopHack at http://www.osuweb.net/~pc/pca/pc_all.zip
pedit/pToolSet/LapTopHack scripting info/resources at http://www.peditors.com
Peditors Forum http://groups.yahoo.com/group/peditors
Unsubscribe by writing to peditors-unsubscribe-hHKSG33Tihh4sT85+ipIM4ckdKdSAMto@public.gmane.org! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/peditors/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/peditors/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/