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

[NTB] Match Tag

Expand Messages
  • Claes Gauffin
    The Match HTML Tag clip by Kay Roath in the last NoteTab Tips and Clips is very neat, and quite useful for any SGML code. Thanks a lot! The following little
    Message 1 of 1 , Oct 29, 1998
      The "Match HTML Tag" clip by Kay Roath in the last NoteTab Tips and Clips
      is very neat, and quite useful for any SGML code. Thanks a lot! The
      following little modification should allow you be positioned either in the
      start or the end tag when calling the clip.
      Regards /Claes
      =====================================

      H=MatchTag

      ^!Find < SB

      ^!Set %TagName%=^$GetWord$
      ; save tag name

      ^!If "^$GetChar(+1)$" = "/" EndTag
      ; is this a start or end tag?

      ^!Set %StartRow%=^$GetRow$
      ^!Set %StartCol%=^$GetCol$
      ; save start row & column

      ^!Find /^%TagName% IS
      ; find end tag

      ^!IfError Whoops
      ; go to error message if not found

      ^!MoveCursor +1
      ; get ending >

      ^!SelectTo ^%StartRow%:^%StartCol%
      ^!GoTo End
      ; highlight start to end then exit

      :EndTag
      ^!Find > SF

      ^!Set %EndRow%=^$GetRow$
      ^!Set %EndCol%=^$GetCol$
      ; save end row & column

      ^!Find <^%TagName% ISB
      ; find start tag

      ^!IfError Whoops
      ; go to error message if not found

      ^!SelectTo ^%EndRow%:^%EndCol%
      ^!GoTo End
      ; highlight start to end then exit

      :Whoops
      ^!Prompt No ending tag found </^%TagName%>
      ; display error message if not found

      ------------------------------------------------------------------------
      Subscribe, unsubscribe, opt for a daily digest, or start a new e-group
      at http://www.eGroups.com -- Free Web-based e-mail groups.
    Your message has been successfully submitted and would be delivered to recipients shortly.