>Hi Wayne,
>
>H="Transpose"
>^!Set Size=^$GetSelSize$
>^!InsertText ^$StrCopy("^$GetSelection$^$GetSelection$";2;^%Size%)$
>^!Select -^%Size%
>
>hahaha - Thanks for the toy! Neat!
>
>How to keep Jody busy for hours. :) I yours with 10 numbers and
>clicked and clicked watching the numbers chase each other around.
>I was fascinated. <g> I realize it was made for two digits.

Made for two digits? You know me better than that. It was
intentional that although it works with two characters, that it
also does someone possibly useful when more than two characters
are selected. I always try to keep my programs as widely
applicable as possible.

I should also mention that my clipbook "NoteAwk" ( which can be
found at http://landru.myhome.net/wayne/notetab.html ) contains
two clips to reverse large amounts of selected text. (One clip
reverses the text on each line. The other reverses the order
of selected lines.) It does work for transposing characters,
although it was designed to be much more powerful than that.

I was hoping that "how it works" would be self-evident, but
maybe some of my methods are a bit tricky.

> H="Transpose"
> ^!Set Size=^$GetSelSize$

Stores selection size in variable so we can remember it later.
The clip is designed to work with more than just two characters.

> ^!InsertText ^$StrCopy("^$GetSelection$^$GetSelection$";2;^%Size%)$

I always use InsertText explicitly when the clip contains other clip
commands. Although just plain:
^$StrCopy("^$GetSelection$^$GetSelection$";2;^%Size%)$
should also work here.

^$GetSelection$ used twice gives us (in the clip parser's memory)
two copies of the selection one after the other. This is how I
make sure the first character being transposed follows after the
second. This is simpler than fiddling with individual characters.

^$StrCopy("Some text";StartingPosition;Amount)$ copies a portion
of "Some text". In our case, if the selection was originally two
characters, and we copy two characters from the 2nd position, we
get the last character from the first ^$GetSelection$, and the
first character from the second ^$GetSelection$.

When more than two characters are selected, the clip causes them
to be rotated around, the first character moving behind the last
each time.

> ^!Select -^%Size%

This command was added to make sure the text remains selection.
Since the previous command erased our selection, we needed to
store its size in a variable so we could remember it. Note that
after using ^!InsertText, the cursor is at the end of the new
text. So we use a minus symbol to select the appropriate number
of character backwards from there.

Yes. Wayne used ^$GetSelection$ twice for the criteria to copy
from. So, if you had 12 it would actually be 1212. He then told
it to start at index position 2 and copy the amount of characters
equaling selection size. So he was not actually reversing the
characters, but just getting the last one in the first
^$GetSelection$ and the first in the second ^$GetSelection$ and
that is what was returned. That is why if you used more than two
digits the numbers would rotate in the output instead of reverse
in say a set of 4 digits selected if you repeatedly clicked on
the clip (like me with my new toy). If you do stuff like that
often you would probably be better off getting Wayne's NoteAwk.

1212
1|21|2

In the one I did I just took the selection size and divided by 2
then added one to do the same thing, but it reverses the
characters no matter how long the sets are. I quite don't know
why I had to add one to it but I did.