Re: removing stuff between '<' and '>' ?

John Markley <[email protected]> Tue, 28 Jun 2011 20:25:43 -0400
Newsgroups gmane.comp.handhelds.palm.peditors
Message-ID <[email protected]>
Quoting Voytek Eymont <[email protected]>:
>
> pToolSet
>
> the data is in a text field in 'Hours'
>
> thanks
>
> --
> Voytek

  OK Voytek, here it is.  There are several ways of accomplishing  
this, and this very long pScript chain is I think one of the easiest.   
It will work in any normal text field as long as you have pToolSet on,  
and you have the text cursor flashing anywhere in the field, i.e. it  
is an active text field.
  Less than half of the total chain does the removal of  <blah blah>  
as you requested.  The rest of it is safeguards to prevent undesired  
consequences.  If you run it on some field or app that is not an  
active text field it will do nothing.  If you run it on a text field  
that has "<", but no ">", or vice versa, or neither of them it will  
also do nothing.  It will only run when there is a < and a >.  This is  
important since it eats up < and > and everything between, and if it  
worked if only one or other were there it would eat the whole text  
field.!
  Since it is so long I suggest you copy and paste it into pScriptPad  
rather than try to transcribe it by hand.  Hope this is what you need,  
let me know.

{cut<>::
/*Abort if not text field*/
/&specAct[5]
/&varSet@[$2,$^]
/&ifAbort@[$2==0]
/&script$[@@cut<>0@@]}
{cut<>0::/*Abort if no >*/
/&specAct[8] >
/xEpst f
/&script$[@@no>1@@]}
{no>1::
/!/$f
/&ifScript@Bf[$$==6742,@@no >@@]
/&script$[@@cut<>1@@]}
{no >::
/&mess[@@no >@@]
/xEpst  .
/xEpet o}
{cut<>1::
/&mess[@@ok@@]
/xEpet d
/xEpet o
/0x1D
/&script$[@@cut<>1B@@]}
{cut<>1B::
/&specAct[8] <
/xEpst f
/xEpst d
/&script$[@@cut<>1C@@]}
{cut<>1C::
/!/$f
/&ifScript@Bf[$$==6742,@@no <@@]
/&script$[@@cut<>2@@]}
{cut<>2::
/0x08
/e@
/&varSet@ [$1,$$]
/&ifScript@Bf[$1!=62,@@cut<>3@@]
/&ifScript@Bf[$1==62,@@cut<>4@@]}
{cut<>3::
/0x1D
/0x08
/&script$[@@cut<>2@@]}
{cut<>4::
/0x1D
/0x08
/&mess[@@DONE@@]}
{no <::
/&mess[@@no <@@]
/xEpst  . }

   regards,  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/