Loading ...
Sorry, an error occurred while loading the content.

Working Replace clip!

Expand Messages
  • Sheri
    Hi Alan, Hugo, others, I think I have now perfected the Replace clip so that it works in all situations. Previously vertical bars in prior Replace texts
    Message 1 of 3 , Jul 5, 2002
    • 0 Attachment
      Hi Alan, Hugo, others,

      I think I have now perfected the Replace clip so that it works in all
      situations. Previously vertical bars in prior Replace texts presented a
      problem (although it was sort of working in the previous revision when there
      were vertical bars in prior Search texts - albeit with "^%VBAR" instead of "|").

      Now the "|" show up properly in the ^!Replace statements written by the clip.
      While selecting from prior S/R texts, they temporarily display as "¦" characters.
      I hope "¦" characters aren't prevalent in anyone's documents (and therefore in
      their s/r texts). Since it isn't on the keyboard, I'm assuming "¦" isn't widely used.

      This version of the clip uses Hugo's approach for making the assignments, which
      seemed a bit cleaner. Thanks, Hugo!

      I have incorporated the clip in my copy of the Clip Assistant. If not
      incorporated in the Clip Assistant, the clip must be on the Clipbar for use
      while editing clips. Also, the end of the clip must be changed for it to work
      outside of the Clip Assistant. See remarks in the clip.

      Regards,
      Sheri

      This clip can be viewed and copied without linebreaks at:

      http://groups.yahoo.com/group/ntb-clips/messages/8735?viscount=-1&expand=1

      H="Replace"
      ;07-05-02 enhanced by users to make available previous s/r texts
      ;
      ;substitute this clip for existing Replace clip in the Clip Assistant file (ClipHelp.clh)
      ;
      ;next 7 lines show Eric's original Replace clip
      ;^!Set %Name%=Replace
      ;^!Set %Param%="^?{Find what (use tokens for tabs/paragraphs)}" >> "^?{Replace with (use tokens for tabs/paragraphs)}" ^?{(T=C)Replace all==_Yes^=A|No^=}^?{(T=C)Whole words==_Yes^=C|No^=T|Automatic^=}^?{(T=C)Ignore case==_Yes^=I|No^=}^?{(T=C)Search backwards==Yes^=B|_No^=}^?{(T=C)All documents==Yes^=G|_No^=}^?{(T=C)Whole document==_Yes^=W|No^=}^?{(T=C)Only in selection==Yes^=H|_No^=}^?{(T=C)Regular Expression==Yes^=R|_No^=}^?{(T=C)Display messages==Yes^=|_No^=S}
      ;^!Set %C%=^$DecToChar(127)$^$DecToChar(22)$
      ;^!Set %Param%=^$StrReplace("^^P";"^%C%P";"^%Param%";False;False)$
      ;^!Set %Param%=^$StrReplace("^^T";"^%C%T";"^%Param%";False;False)$
      ;^!Set %Param%=^$StrReplace("^%C%";"^%CARET%^%CARET%";"^%Param%";False;False)$
      ;^!Clip ~ParamCommand
      ;
      ;Revised version follows
      ;
      :Start
      ^!Set %Name%=Replace
      ^!Set %Param%=""
      ^!ProgIniSave
      ^!Set %ChangedKey%=0
      ^!Set %Count%=1
      ^!Set %Key%=Search
      ^!Set %^%Key%List%=""
      :LISTS
      ^!Set %Value%=^$StrReplace("|";"¦";"^$UseTokens(^$GetValue("ReplaceDialog:^%Key%List_^%Count%")$)$";No;No)$
      ^!IfTrue ^$IsEMPTY(^%Value%)$ CHANGEKEY
      ^!Append %^%Key%List%=^%Value%|
      ^!INC %Count%
      ^!GoTO LISTS
      :CHANGEKEY
      ^!IfTrue ^%ChangedKey% DOPARAM
      ^!Set %ChangedKey%=1
      ^!Set %Count%=1
      ^!Set %Key%=Replace
      ^!Set %^%Key%List%=""
      ^!GoTO LISTS
      :DOPARAM
      ^!Set %Param%="^?{Find what (use tokens for tabs/paragraphs)=^%SearchList%}" >> "^?{Replace with (use tokens for tabs/paragraphs)=^%ReplaceList%}" ^?{(T=C)Replace all==_Yes^=A|No^=}^?{(T=C)Whole words==_Yes^=C|No^=T|Automatic^=}^?{(T=C)Ignore case==_Yes^=I|No^=}^?{(T=C)Search backwards==Yes^=B|_No^=}^?{(T=C)All documents==Yes^=G|_No^=}^?{(T=C)Whole document==_Yes^=W|No^=}^?{(T=C)Only in selection==Yes^=H|_No^=}^?{(T=C)Regular Expression==Yes^=R|_No^=}^?{(T=C)Display messages==Yes^=|_No^=S}
      ^!Set %Param%=^$StrReplace("¦";"^%VBAR%";"^%Param%";False;False)$
      ^!Set %C%=^$DecToChar(127)$^$DecToChar(22)$
      ^!Set %Param%=^$StrReplace("^^P";"^%C%P";"^%Param%";False;False)$
      ^!Set %Param%=^$StrReplace("^^T";"^%C%T";"^%Param%";False;False)$
      ^!Set %Param%=^$StrReplace("^%C%";"^%CARET%^%CARET%";"^%Param%";False;False)$
      ^!Clip ~ParamCommand
      ;to use this clip outside of the Clip Assistant, comment out the ^!Clip ~ParaCommand
      ;and uncomment the following line
      ;^!InsertText ^!^%Name% ^%Param%^P
      ;end of clip
    • silvermoonwoman2001
      I ve found a problem that can foul up my clip s result. If any of the prior s/r items has an unmatched curly brace in it (i.e., a left OR a right curly
      Message 2 of 3 , Jul 10, 2002
      • 0 Attachment
        I've found a problem that can foul up my clip's result. If any of
        the prior s/r items has an unmatched curly brace in it (i.e., a left
        OR a right curly brace): things look like they're working when you
        select or enter text in the wizards, but the output command has a lot
        of extraneous text from unchosen s/r lines in it.
      • hpaulissen
        Hi sheri, If any of ... left ... lot ... Join the club ;-) ( I m only having problems with { and } appearing in the wizards (I guess if these appear in the
        Message 3 of 3 , Jul 11, 2002
        • 0 Attachment
          Hi sheri,

          If any of
          > the prior s/r items has an unmatched curly brace in it (i.e., a
          left
          > OR a right curly brace): things look like they're working when you
          > select or enter text in the wizards, but the output command has a
          lot
          > of extraneous text from unchosen s/r lines in it.

          Join the club ;-)

          ("I'm only having problems with { and }
          appearing in the wizards (I guess if these appear in the ini, they
          are interpreted as some clipcode)." - quote from a few messages ago)

          I'm not sure it has to do with matching or non matching. The first
          curly brace "}" just is recognised as the end of the wizard. That's
          why I like Harveys approach better (you can insert all characters
          without difficulties in a plain document)...

          Regards,

          Hugo
        Your message has been successfully submitted and would be delivered to recipients shortly.