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

Re: if find give a true value?

Expand Messages
  • ebbtidalflats
    Try String Position (on selection): ^!If ^$StrPos( Special ; ^$GetSelection$ ;0)$ 1 SPECIAL else NORMAL if the selection contains the first string (Special) it
    Message 1 of 6 , Feb 2 1:25 PM
    • 0 Attachment
      Try String Position (on selection):

      ^!If ^$StrPos("Special";"^$GetSelection$";0)$>1 SPECIAL else NORMAL

      if the selection contains the first string (Special) it jumps to the
      SPECIAL lable, else it jumps to NORMAL (or whatever label name you
      use, or OMIT the else part, and flas jumps to next line.


      Eb

      --- In ntb-clips@yahoogroups.com, "dpasseng" <don@...> wrote:
      >
      > is it possible to select text, use a find within an if statement to
      > see if the text is found in the selection and if true, goto set
      place ...
      >
      > Not quite getting it:
      > ^!Select Eol
      > ^!If "^!Find "Special" CIHRS" = "1" Special
      >
      >
      > It goes to special every time, but I would expect it only to go there
      > if the selection contained the word Special (which it does not).
      >
    • Don - HtmlFixIt.com
      ... I was trying to actually use a regex even though I never disclosed that. Hence the find.
      Message 2 of 6 , Feb 2 3:53 PM
      • 0 Attachment
        ebbtidalflats wrote:
        > Try String Position (on selection):
        >
        > ^!If ^$StrPos("Special";"^$GetSelection$";0)$>1 SPECIAL else NORMAL
        >
        > if the selection contains the first string (Special) it jumps to the
        > SPECIAL lable, else it jumps to NORMAL (or whatever label name you
        > use, or OMIT the else part, and flas jumps to next line.
        >
        >
        > Eb
        >
        I was trying to actually use a regex even though I never disclosed that.
        Hence the find.
      • Alan C
        Oop I had it reversed. So, now, to un reverse So, perhaps ^!Find line here ^!IfError Skip ^!Goto Special ^!code carrys on here is what might work since you
        Message 3 of 6 , Feb 2 6:46 PM
        • 0 Attachment
          Oop I had it reversed. So, now, to "un reverse"

          So, perhaps

          ^!Find line here
          ^!IfError Skip
          ^!Goto Special
          ^!code carrys on here

          is what might work since you reported you need it to go to Special "when
          found"

          in the above code, when not found it skips the goto special line.

          when found, it likely will not skip which will make it goto special. | Alan.

          On Mon, Feb 2, 2009 at 3:53 PM, Don - HtmlFixIt.com <don@...>wrote:

          > ebbtidalflats wrote:
          > > Try String Position (on selection):
          > >
          > > ^!If ^$StrPos("Special";"^$GetSelection$";0)$>1 SPECIAL else NORMAL
          > >
          > > if the selection contains the first string (Special) it jumps to the
          > > SPECIAL lable, else it jumps to NORMAL (or whatever label name you
          > > use, or OMIT the else part, and flas jumps to next line.
          > >
          > >
          > > Eb
          > >
          > I was trying to actually use a regex even though I never disclosed that.
          > Hence the find.
          >
          > ------------------------------------
          >
          > Fookes Software: http://www.fookes.com/
          > NoteTab website: http://www.notetab.com/
          > NoteTab Discussion Lists: http://www.notetab.com/groups.php
          >
          > ***
          > Yahoo! Groups Links
          >
          >
          >
          >


          [Non-text portions of this message have been removed]
        • Don - HtmlFixIt.com
          ... aha and duh on me at the same time ... I think this will work. I used something very similar over the weekend and yet didn t see this answer ... thank you
          Message 4 of 6 , Feb 2 7:43 PM
          • 0 Attachment
            Alan C wrote:
            > Oop I had it reversed. So, now, to "un reverse"
            >
            > So, perhaps
            >
            > ^!Find line here
            > ^!IfError Skip
            > ^!Goto Special
            > ^!code carrys on here
            >
            > is what might work since you reported you need it to go to Special "when
            > found"
            >
            > in the above code, when not found it skips the goto special line.
            >
            > when found, it likely will not skip which will make it goto special. | Alan.


            aha and duh on me at the same time ... I think this will work. I used
            something very similar over the weekend and yet didn't see this answer
            ... thank you for pointing it out

            I need to test, but in theory I think it works perfectly.
          Your message has been successfully submitted and would be delivered to recipients shortly.