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

Re: [Clip] Re: Find and IfTrue

Expand Messages
  • Mr. Phillip Sand Hansel II
    Thanks, that helps, I was being too ambitious I guess. At first I did not think I wanted to do what you suggested, I only wanted to change part of what I found
    Message 1 of 3 , Dec 5, 2006
    • 0 Attachment
      Thanks, that helps, I was being too ambitious I guess. At first I did not
      think I wanted to do what you suggested, I only wanted to change part of
      what I found (I thought it would replace the full "found" string). But when
      I tried it, I understood that you were quite right, and it works great. I
      first tried it with labels, but since I know the data, I realized that SKIP
      would do me just as good.

      This is what I ended up with, not pretty, but it works.

      ^!Jump DOC_START
      ^!Find RPCS\.OHMM.*2-MHZ RS
      ^!IfError SKIP
      ^!Replace RPCS.OHMM RPCSHM.OHMM SIH
      ^!Jump DOC_START
      ^!Find RPCS\.OHMM.*400-KHZ RS
      ^!IfError SKIP
      ^!IfTrue ^!Replace RPCS.OHMM RPCSLM.OHMM SIH
      ^!Jump DOC_START
      ^!Find RACS\.OHMM.*2-MHZ RS
      ^!IfError SKIP
      ^!IfTrue ^!Replace RACS.OHMM RACSHM.OHMM SIH
      ^!Jump DOC_START
      ^!Find RACS\.OHMM.*400-KHZ RS
      ^!IfError SKIP
      ^!IfTrue ^!Replace RACS.OHMM RPCSLM.OHMM SIH


      (Sure, Jody did it in '78 and hsavage would do it in one line, but for me
      this is progress!)




      Mr. Phillip Sand Hansel II
      http://philliphansel.com


      ----- Original Message -----
      From: "Sheri" <silvermoonwoman@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Tuesday, December 05, 2006 2:30 PM
      Subject: [Clip] Re: Find and IfTrue


      > --- In ntb-clips@yahoogroups.com, "Mr. Phillip Sand Hansel II"
      > <mr.phillip@...> wrote:
      >
      >> I can find it with this...
      >>
      >> ^!Find RPCS\.OHMM.*2-MHZ R
      >>
      >> if that is found, I would like to do this...
      >> ^!Replace RPCS.OHMM RPCSHM.OHMM SIH
      >>
      >>
      >> I thought I could do this....
      >> ^!fTrue ^!Find RPCS\.OHMM.*2-MHZ R ^!Replace RPCS.OHMM RPCSHM.OHMM SIH
      >>
      >
      > You will need to take things one step at a time:
      >
      > :Start
      > ^!Find "whatever" RS
      > ^!IfError FindErrorLabel
      > ;if you get here whatever must be highlighted - your IfTrue condition
      > ^!Replace "whateverhighlighted" >> "proper replacement" SIH
      > ^!IfError ReplaceErrorLabel
      > ;what next? Advance to next line?
      > ^!Jump +1
      > ;next find the next match?
      > ^!Goto Start
      > ;end of processing
      > :FindErrorLabel
      > ^!Prompt There are no more "whatevers"
      > ^!Goto End
      > :ReplaceErrorLabel
      > ^!Prompt I guess this should never happen.
      > ^!Goto End
      > ;end of clip
      >
      > Hope that helps.
      >
      > Regards,
      > Sheri
      >
      >
      >
      > Fookes Software: http://www.fookes.us, http://www.fookes.com
      > Fookes Software Mailing Lists: http://www.fookes.us/maillist.htm
      >
      > Yahoo! Groups Links
      >
      >
      >
    • Sheri
      I would remove those ^!IfTrue commands from the front of your ^!Replace commands. IfTrue is for branching to a label based on a boolean value. From clip help:
      Message 2 of 3 , Dec 5, 2006
      • 0 Attachment
        I would remove those ^!IfTrue commands from the front of your
        ^!Replace commands.

        IfTrue is for branching to a label based on a boolean value.

        From clip help:

        ^!IfTrue Value GoToLabelTrue [ELSE GoToLabelFalse]

        If Value is equal to 1, TRUE, YES, Y, or ON (case insensitive), then
        jumps to specified label name. Do not use comparison operators with
        this command; in that case, you should use the ^!If command to do a
        comparison between two values.

        Regards,
        Sheri
      • Mr. Phillip Sand Hansel II
        My bad. Those were left over from a prior effort. And, I only tested the first case. :-/ And I had been staring at the code too long and not seeing the obvious
        Message 3 of 3 , Dec 5, 2006
        • 0 Attachment
          My bad. Those were left over from a prior effort. And, I only tested the
          first case. :-/ And I had been staring at the code too long and not seeing
          the obvious things.

          thanks a bunch,
          Mr. Phillip Sand Hansel II
          http://philliphansel.com


          ----- Original Message -----
          From: "Sheri" <silvermoonwoman@...>
          To: <ntb-clips@yahoogroups.com>
          Sent: Tuesday, December 05, 2006 4:16 PM
          Subject: [Clip] Re: Find and IfTrue


          >I would remove those ^!IfTrue commands from the front of your
          > ^!Replace commands.
          >
          > IfTrue is for branching to a label based on a boolean value.
          >
          > From clip help:
          >
          > ^!IfTrue Value GoToLabelTrue [ELSE GoToLabelFalse]
          >
          > If Value is equal to 1, TRUE, YES, Y, or ON (case insensitive), then
          > jumps to specified label name. Do not use comparison operators with
          > this command; in that case, you should use the ^!If command to do a
          > comparison between two values.
          >
          > Regards,
          > Sheri
          >
          >
          >
          > Fookes Software: http://www.fookes.us, http://www.fookes.com
          > Fookes Software Mailing Lists: http://www.fookes.us/maillist.htm
          >
          > Yahoo! Groups Links
          >
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.