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

if find give a true value?

Expand Messages
  • dpasseng
    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
    Message 1 of 6 , Jan 31, 2009
    • 0 Attachment
      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).
    • Alan C
      ^!IfError my_label if item was not found, goes to label you can check it. note the revised below ... ^!Find Special CIHRS ... [Non-text portions of this
      Message 2 of 6 , Feb 1, 2009
      • 0 Attachment
        ^!IfError my_label

        if item was not found, goes to label

        you can check it. note the revised below

        On Sat, Jan 31, 2009 at 11:41 AM, 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

        ^!Find "Special" CIHRS"
        > ^!IfError 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).
        >
        >
        >
        > ------------------------------------
        >
        > 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]
      • 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 3 of 6 , Feb 2, 2009
        • 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 4 of 6 , Feb 2, 2009
          • 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 5 of 6 , Feb 2, 2009
            • 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 6 of 6 , Feb 2, 2009
              • 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.