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

Delete all but the current selection

Expand Messages
  • Axel Berger
    From graphics programs I have become accustomed to being able to select a block and either delete it or delete everything around it and leave only the block
    Message 1 of 3 , Aug 21, 2014
    • 0 Attachment
      From graphics programs I have become accustomed to being able to select a
      block and either delete it or delete everything around it and leave only
      the block itself.

      I have found a solution (untried as of now), but I wonder, if someone here
      can think of a more elegant one:

      ^!Set %varALL%=^$GetSelection$
      ^!Select ALL
      ^!InsertText ^%varALL%
      ^!Jump TEXT_START
      ^!ClearVariable %varALL%

      It's an old habit from the time of much smaller machines, but I try to
      avoid placing (potentially) huge chunks of text into variables.

      Danke
      Axel
    • flo.gehrke
      ... ^!Replace ^$GetText$ ^$GetSelection$ WS Regards, Flo
      Message 2 of 3 , Aug 22, 2014
      • 0 Attachment
        ---In ntb-clips@yahoogroups.com, <Axel@...> wrote :

        > select a block and...delete everything around it and leave only
        > the block itself.

        ^!Replace "^$GetText$" >> "^$GetSelection$" WS

        Regards,
        Flo
      • Axel Berger
        ... Nice, but is it better? First you save the complete text in a pseudovariable, then you do a humungeous Find with a giant find term. In all I think my
        Message 3 of 3 , Aug 22, 2014
        • 0 Attachment
          "flo.gehrke@... [ntb-clips]" wrote:
          > ^!Replace "^$GetText$" >> "^$GetSelection$" WS

          Nice, but is it better? First you save the complete text in a
          pseudovariable, then you do a humungeous Find with a giant find term. In
          all I think my solution uses many more lines but far less resources.

          Danke
          Axel
        Your message has been successfully submitted and would be delivered to recipients shortly.