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

4202Re: [Clip] Extending selection in clip

Expand Messages
  • Jody
    Jul 30, 2000
    • 0 Attachment
      Hi Scott,

      > What I've been doing is using ^!Find to get to a block of text
      > (in this case a specific combination of HTML tags), then using
      > ^!Keyboard to unselect the found text and set the input
      > location to the beginning of the text just after the found
      > block.

      Try ^!Jump Select_Start instead of ^!Keyboard.

      > Isn't there a way to extend a selection to an arbitrary found
      > item? That is, start from any given input location, and then do
      > a find where the selection extends to the found item.

      There is a full blown working example of what you want to do in the
      Utilities Library in a Clip called Select between Tags.

      Here are two simplified ways:

      <--- Copy below this line --->
      H=Tag Select I
      ; Last Updated 07/30/2000, Sojourner@..., jody
      ^!SetScreenUpdate Off
      :Loop
      ^!Find "<font" S
      ^!IfError End
      ^!Find ">" S
      ^!Jump Select_End
      ^!Set %Start%=^$GetRow$:^$GetCol$
      ^!Find "</font" S
      ^!Jump Select_Start
      ^!SelectTo ^%Start%
      ^!InsertText ^?{Replace with=^$GetSelection$}
      ^!Skip Abort?
      ^!Goto Loop


      H=Tag Select II
      ; Last Updated 07/30/2000, Sojourner@..., jody
      ^!Set %TagStart%=<^?{Enter start tag name without arrows}
      ^!Set %TagEnd%=^$StrInsert("/";"^%TagStart%";2)$
      ^!SetScreenUpdate Off
      :Loop
      ^!Find "^%TagStart%" S
      ^!IfError End
      ^!Find ">" S
      ^!Jump Select_End
      ^!Set %Start%=^$GetRow$:^$GetCol$
      ^!Find "^%TagEnd%" S
      ^!Jump Select_Start
      ^!SelectTo ^%Start%
      ^!InsertText ^?{Replace with=^$GetSelection$}
      ^!Skip Abort?
      ^!Goto Loop

      <--- Copy above this line, right --->
      <--- click over a Library, and --->
      <--- choose "Add from Clipboard" --->

      Happy Clip'n!
      Jody

      http://www.sureword.com/notetab

      Subscribe, UnSubscribe, Options
      mailto:Ntb-Clips-Subscribe@...
      mailto:Ntb-Clips-UnSubscribe@...
      http://www.egroups.com/group/ntb-clips
    • Show all 4 messages in this topic