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

Re: [Clip] How to clear ^&

Expand Messages
  • Axel Berger
    ... Solved that one. Just add ^!Set %AR_KEY%=^%EMPTY% to the clip. But that s a very partial solution. I still want to place the cursor in the middle of an
    Message 1 of 8 , Jun 14, 2012
    • 0 Attachment
      Axel Berger wrote:
      > Started through autorun it will insert that spurious space,

      Solved that one. Just add

      ^!Set %AR_KEY%=^%EMPTY%

      to the clip. But that's a very partial solution. I still want to place
      the cursor in the middle of an ^!Insert sometimes. Then I need an empty
      ^& with nothing but its cursor positioning function.

      Axel
    • Art Kocsis
      ... That is strange. I have used this throughout my library but instead of ^P I used ^%nl% and have never seen an extra space following the ^%nl%. Do you see
      Message 2 of 8 , Jun 14, 2012
      • 0 Attachment
        At 6/14/2012 07:53 AM, Axel wrote:
        >Yes. Let me start with a preliminary. Let's have an autorun clip called
        >"<0a" and containing
        >"^!InsertText something^P^&". You invoke it by typing "<0a ". With ^&
        >that last space does nothing, without it you end up with
        ><newline><space>. So I always use ^!Insert with ^&

        That is strange.

        I have used this throughout my library but instead of ^P I used ^%nl%
        and have never seen an extra space following the ^%nl%.

        Do you see the same behavior using ^%nl%?

        Are you running NTS or NTP? Which version?

        Art
      • flo.gehrke
        ... In NT 7.0, you could use the new ^!DeleteSelection command. IMHO, ^& is nothing that could be cleared like a variable. NT sticks to the string that
        Message 3 of 8 , Jun 15, 2012
        • 0 Attachment
          --- In ntb-clips@yahoogroups.com, Axel Berger <Axel-Berger@...> wrote:

          > The very next things I want to do is delete the selection and
          > clear the ^&. The first can be done through ^!Keyboard DELETE,
          > although I'd like a better and more specific way, and the second
          > I don't know how to do at all.

          In NT 7.0, you could use the new '^!DeleteSelection' command.

          IMHO, '^&' is nothing that could be "cleared" like a variable. NT sticks to the string that has been selected when starting the clip. Neither removing that string nor executing '^!Select 0' can "clear" the '^&' token. If I'm not mistaken, it's "empty" only if you start another clip (no subclip!) without having selected anything.

          As Sheri once put it: '^&' is "a shorthand for preselected text (preselected prior to executing your clip)" (3.3.2007, #16164). Also: "The '^&' is not an argument pass-er, it is the argument pass-ed" (1.12.2008, #18759). Consequently, it's just a side effect that -- on certain conditions -- '^&' seems to be able to "position the cursor".

          > The label ^& fulfils two functions. It saves and inserts what
          > was selected before running the clip and it positions the cursor.

          '^&' also works as a parameter string without selecting anything. Example: If you run...

          ; Start clip
          ^!Clip Names Otto

          ; Subclip 'Names'
          ^!Info His name was ^&

          ...the name 'Otto' will be displayed in an info box without selecting any text.

          Regards,
          Flo


          P.S. BTW, where is Sheri? I strongly miss her expertise!
        • Axel Berger
          ... Pro, version 6.2. And the behaviour described is documented in the main help file: Note that if the Clip contains the cursor-positioning code ^&, the
          Message 4 of 8 , Jun 15, 2012
          • 0 Attachment
            Art Kocsis wrote:
            > Are you running NTS or NTP? Which version?

            Pro, version 6.2. And the behaviour described is documented in the main
            help file:
            "Note that if the Clip contains the cursor-positioning code ^&, the
            activating key is automatically discarded. You can also use the
            activating key in Clip code through the new predefined variable
            ^%AR_KEY%."

            Reversing that: no ^& means no discard of the last character typed. Have
            you tried my minimal example?

            Axel
          • Axel Berger
            ... That s bad. Whenever a wizard inserts a more or less complicated environment the cursor should be placed in some specific spot right in the middle and
            Message 5 of 8 , Jun 15, 2012
            • 0 Attachment
              "flo.gehrke" wrote:
              > Consequently, it's just a side effect that -- on certain
              > conditions -- '^&' seems to be able to "position the cursor".

              That's bad. Whenever a wizard inserts a more or less complicated
              environment the cursor should be placed in some specific spot right in
              the middle and whenever marking up an ASCII source selecting smething to
              run a clip on is often desirable. It can

              a) save an extra <Ctrl><C> and <Ctrl><V> inside the wizard and
              b) I can highlight one thing and paste another.

              In my link wizard I highlight the text that is to become the link and
              paste the destination.

              By the way:
              > In NT 7.0,

              Must get around to going over. Any known gotchas, stuff that won't work
              as before?

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