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

Re: [Clip] Re: Looping a search and replacement

Expand Messages
  • Patrick-Julien Germain
    Thanks Alan, and a special thanks to you Sheri. Alan and Sheri, let me time to carefully look at your code. I will revert to you with comments and certainly
    Message 1 of 1 , Aug 6, 2002
    • 0 Attachment
      Thanks Alan, and a special thanks to you Sheri.
      Alan and Sheri, let me time to carefully look at your code.
      I will revert to you with comments and certainly questions.

      I was not expecting someone to produce code, just give a clue.

      Anyway, merci beaucoup, de tout coeur!

      pjg


      ----- Original Message -----
      From: "silvermoonwoman2001" <silvermoonwoman@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Tuesday, August 06, 2002 9:49 PM
      Subject: [Clip] Re: Looping a search and replacement


      --- In ntb-clips@y..., "Patrick-Julien Germain" <pjg@f...> wrote:
      <snip>

      > How can I write a loop searching for each occurrence and writing its
      > replacement text?
      >
      > I unsuccessfully searched the Help for loop or similar items--this
      > particular paragraph is meant for Sheri (=:
      >
      > Any idea or advice?
      >
      > Thanks in advance.
      >

      Hi Patrick,

      Notetab clips let us goto labels, either because of a ^!Goto command
      or because tested conditions. The documentation entry on Labels
      should be helpful.

      Meanwhile, try to learn by this example ;)

      You could add a ^!Jump Doc_Start before the :Start label; otherwise,
      it will run forward from the current cursor location until no more
      email addys are found, or until canceled.

      By the way I don't do HTML, so let me know if the attached works
      properly. I went strictly by your example, and because I read this
      forum at Yahoo, I couldn't even see the m e @ m y i s p . c o m <g>

      Regards,
      Sheri

      H="HTML ChartoDec Email Addys"
      ;08/06/2002 by Sheri Pierce
      :Start
      ^!Find "[A-Z_.-0-9]+@[A-Z_.-0-9]+" IRS
      ^!IfError End
      ;comment out the next 3 lines to avoid prompting
      ^!Set %doit%=^?{Encode All ^$GetSelection$?==_Yes|No}
      ^!IfCancel End
      ^!If ^%doit%="No" Start
      ^!Set %TarLength%=^$GetSelSize$
      ^!Set %Find%=^$GetSelection$
      ^!Set %Trans%=^%Empty%
      ^!Set %i%=0
      :LoopTarget
      ^!If ^%i%>^%TarLength% Out
      ^!Inc %i%
      ^!Append %Trans%=&#^$CharToDec(^$StrCopy("^$GetSelection$";^%i%;1)$)$;
      ^!Goto LoopTarget
      :Out
      ^!InsertSelect "^$StrDeleteRight("^%Trans%";3)$"
      ^!Set %Replace%=^$GetSelection$
      ^!Jump Select_End
      ^!Replace "^%Find%" >> "^%Replace%" AIS
      ^!Goto Start
      :End
      ^!ClearVariable %doit%
      ^!ClearVariable %TarLength%
      ^!ClearVariable %Find%
      ^!ClearVariable %Replace%
      ^!ClearVariable %Trans%
      ^!Prompt All Done
      ;end of clip





      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    Your message has been successfully submitted and would be delivered to recipients shortly.