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

Please help with string concat. & tokens

Expand Messages
  • steveadausa@yahoo.com
    Hi Everybody, I am trying to concatenate (sp?) some text strings. I want to make a clip that will change a line of text being any string to Lany string l .
    Message 1 of 8 , Sep 5, 2001
    • 0 Attachment
      Hi Everybody,

      I am trying to concatenate (sp?) some
      text strings. I want to make a clip
      that will change a line of text being "any string"
      to "\Lany string\l".

      I know how to capture the string, and set it
      to a variable, and I thought I knew how to
      add the desired substrings to the beginning
      and end of the main string (see below).

      H="Underline MText"
      ^!Select Line
      ^!Set %var1%=^$GetSelection$
      ^!InsertText \L^%var1%\l

      But the problem comes when I "InsertText"
      the new string, it inserts the \L^%var1%
      but puts the last 2 characters "\l" on the line
      below.

      I know this may have something to do with tokens,
      and I have experimented but to no avail.

      Any suggestions will be appreciated.

      Thank you very much,
      Steve Adams NTP
    • Andy Young
      Hi, Steve, ... The reason the clip adds a return is because ^!Select Line selects the entire line plus its end of indicator (i.e. a new line, end of paragraph,
      Message 2 of 8 , Sep 5, 2001
      • 0 Attachment
        Hi, Steve,

        > But the problem comes when I "InsertText"
        > the new string, it inserts the \L^%var1%
        > but puts the last 2 characters "\l" on the line
        > below.

        The reason the clip adds a return is because ^!Select Line selects
        the entire line plus its end of indicator (i.e. a new line, end of
        paragraph, or return). I added a line to remove the end of line
        indicator. BTW I prefer to use ^%NL% as opposed to ^P

        Andy

        H="Underline MText"
        ^!Select Line
        ^!Set %var1%=^$GetSelection$
        ^!Set %var1%=^$StrReplace("^%NL%";"";"^%var1%";False;False)$
        ^!InsertText \L^%var1%\l
      • steveadausa@yahoo.com
        ... Hi Andy, Thank you for your help. If I try your code on a line of text which does not have another line of text below it, it works great; but if I do have
        Message 3 of 8 , Sep 5, 2001
        • 0 Attachment
          > H="Underline MText"
          > ^!Select Line
          > ^!Set %var1%=^$GetSelection$
          > ^!Set %var1%=^$StrReplace("^%NL%";"";"^%var1%";False;False)$
          > ^!InsertText \L^%var1%\l

          Hi Andy,

          Thank you for your help. If I try your code
          on a line of text which does not have another
          line of text below it, it works great; but if
          I do have a line of text below the line I'm
          selecting, the line below jumps up to the line
          I'm at:

          before: ffffffff
          hhhhhhhh

          after: \Lffffffff\lhhhhhhhh

          Any ideers? BTW, is there a list somewhere
          of those tokens and what they do?

          Thank you,
          Steve
        • Harvey R. Savage
          ... Hi Steve, Try this clip, should work! H= Underline MText ^!Select Line ^!Set %var1%=^$StrReplace( ^p ; ;^$GetSelection$;0;0)$ ^!Insert L^%var1% l^p
          Message 4 of 8 , Sep 5, 2001
          • 0 Attachment
            steveadausa@... wrote:
            >
            > Hi Everybody,
            >
            > I am trying to concatenate (sp?) some
            > text strings. I want to make a clip
            > that will change a line of text being "any string"
            > to "\Lany string\l".
            >
            > I know how to capture the string, and set it
            > to a variable, and I thought I knew how to
            > add the desired substrings to the beginning
            > and end of the main string (see below).
            >
            > H="Underline MText"
            > ^!Select Line
            > ^!Set %var1%=^$GetSelection$
            > ^!InsertText \L^%var1%\l
            >

            > Thank you very much,
            > Steve Adams NTP


            Hi Steve,

            Try this clip, should work!

            H="Underline MText"
            ^!Select Line
            ^!Set %var1%=^$StrReplace("^p";"";^$GetSelection$;0;0)$
            ^!Insert "\L^%var1%\l^p"


            hrs
          • steveadausa@yahoo.com
            ... Lovely! That does work! Thank you, HRS. -Steve
            Message 5 of 8 , Sep 5, 2001
            • 0 Attachment
              > Try this clip, should work!
              >
              > H="Underline MText"
              > ^!Select Line
              > ^!Set %var1%=^$StrReplace("^p";"";^$GetSelection$;0;0)$
              > ^!Insert "\L^%var1%\l^p"

              Lovely! That does work!

              Thank you, HRS.

              -Steve
            • Harvey R. Savage
              ... Hi Steve, Try this clip, should work! H= Underline MText ^!Select Line ^!Set %var1%=^$StrReplace( ^p ; ;^$GetSelection$;0;0)$ ^!Insert L^%var1% l^p
              Message 6 of 8 , Sep 5, 2001
              • 0 Attachment
                steveadausa@... wrote:
                >
                > Hi Everybody,
                >
                > I am trying to concatenate (sp?) some
                > text strings. I want to make a clip
                > that will change a line of text being "any string"
                > to "\Lany string\l".
                >
                > I know how to capture the string, and set it
                > to a variable, and I thought I knew how to
                > add the desired substrings to the beginning
                > and end of the main string (see below).
                >
                > H="Underline MText"
                > ^!Select Line
                > ^!Set %var1%=^$GetSelection$
                > ^!InsertText \L^%var1%\l
                >

                > Thank you very much,
                > Steve Adams NTP


                Hi Steve,

                Try this clip, should work!

                H="Underline MText"
                ^!Select Line
                ^!Set %var1%=^$StrReplace("^p";"";^$GetSelection$;0;0)$
                ^!Insert "\L^%var1%\l^p"


                hrs

                This was Undeliverable the first time.
              • Harvey R. Savage
                ... Hi Steve, As I said on the NoteTab list, the clip you want would be similar to underline mtext clip. This clip does what you ask by dropping your added
                Message 7 of 8 , Sep 5, 2001
                • 0 Attachment
                  Harvey R Savage wrote:
                  >
                  > Hi Steve,
                  >
                  > Try this clip, should work!
                  >
                  > H="Underline MText"
                  > ^!Select Line
                  > ^!Set %var1%=^$StrReplace("^p";"";^$GetSelection$;0;0)$
                  > ^!Insert "\L^%var1%\l^p"
                  >
                  > hrs
                  >
                  > This was Undeliverable the first time.
                  >
                  Hi Steve,

                  As I said on the NoteTab list, the clip you want would be similar
                  to underline mtext clip.

                  This clip does what you ask by dropping your added characters and
                  a ^!Jump line.

                  ^!Insert, in the first clip can be changed to ^!InsertText. I
                  think the latter is the newer command.

                  h="DupeLine"
                  ^!Select Line
                  ^!Set %var1%=^$StrReplace("^p";"";^$GetSelection$;0;0)$
                  ^!Jump -2
                  ^!InsertText ^%var1%


                  hrs
                • Alan C.
                  Hi Everybody, ... H= Underline MText_2 ^!Jump LINE_START ^!Select EOL ^!Set %var1%=^$GetSelection$ ^!InsertText L^%var1% l the above selects line, does so
                  Message 8 of 8 , Sep 5, 2001
                  • 0 Attachment
                    Hi Everybody,

                    >text strings. I want to make a clip
                    >that will change a line of text being "any string"
                    >to "\Lany string\l".

                    H="Underline MText_2"
                    ^!Jump LINE_START
                    ^!Select EOL
                    ^!Set %var1%=^$GetSelection$
                    ^!InsertText \L^%var1%\l


                    the above selects line, does so without getting the line break at the end
                    of the line

                    Regard your other clip or this clip or any clip for that matter > if it
                    works: use it

                    that's my motto. I only shared the above not necessarily because of
                    why. However, perhaps due to its counterpart

                    Why not
                    ------

                    Have fun. Alan.
                  Your message has been successfully submitted and would be delivered to recipients shortly.