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

Re: [Clip] RE: mc Clipboard

Expand Messages
  • Wayne VanWeerthuizen
    ... Try this instead: ^!SET %V%= ^$GetSelection$ ^!InsertText ^%V% In the clip language, it is best always to use quotes around strings. -- Wayne M.
    Message 1 of 14 , May 24, 2000
      "Igor Podlubny" <wp001@...> wrote:

      >This is very obvious, if you try the following clip:
      >
      >^!SET %V%=^$GetSelection$
      >^!InsertText ^%V%
      >
      >on the sentense
      >""Select this sentense with "quotes" and run the above clip""
      >The double quotes at the beginning and at the end will dissapear after you
      >run the above clip.
      >
      >It is worth mentioning that if at least one space after the closing quotes
      >(or before the opening quotes) is selected, then the outer quotes will not
      >dissapear.

      Try this instead:

      ^!SET %V%="^$GetSelection$"
      ^!InsertText "^%V%"

      In the clip language, it is best always to use quotes around strings.




      --
      Wayne M. VanWeerthuizen
      Homepage: http://landru.myhome.net/wayne
    • Jody
      Hi Wayne & Igor, ... I don t think so when using InsertText; it really should not matter. Your example also strips a set of quotes out. Try the following on
      Message 2 of 14 , May 24, 2000
        Hi Wayne & Igor,

        >> ^!SET %V%=^$GetSelection$
        >> ^!InsertText ^%V%
        >> ""Select this sentense with "quotes" and run the above clip""

        > Try this instead:
        >
        > ^!SET %V%="^$GetSelection$"
        > ^!InsertText "^%V%"
        >
        > In the clip language, it is best always to use quotes around strings.

        I don't think so when using InsertText; it really should not
        matter. Your example also strips a set of quotes out. Try
        the following on these with the quotes:

        ""Test This.""

        ^!SET %V%=^$GetSelection$
        ^!InsertText "^%V%"

        Now try this on it:

        ^!SET %V%=^$GetSelection$
        ^!InsertText ""^%V%""

        Actually, I think it should be that if quotes are used with
        InsertText that they are treated as literals. The reason for me
        thinking that way is they are text and NoteTab knows that
        everything following the command is to be inserted. There is no
        delimiter needed. That is the way TextToFile works.

        I never use quotes around my InsertText and have never seen a
        problem until now and in this case it can be worked around if
        need be. Help does not show they are required, nor does it give
        it as an option, not to say they cannot be used though.

        ^!InsertText Any text with tokens (^p/^t)

        I built a Clip a few weeks ago that required a double quote for
        what seemed to be a needed a work-around. I'll see if I can find
        it.

        Try quotes around the second have of TextToFile sometime. :)

        ^!TextToFile "FileName" AnyText

        Happy Clip'n!
        Jody

        http://www.sureword.com/notetab

        Subscribe, UnSubscribe, Options
        mailto:Ntb-Clips-Subscribe@...
        mailto:Ntb-Clips-UnSubscribe@...
        http://www.egroups.com/group/ntb-clips
      • Wayne VanWeerthuizen
        ... With my example (as shown above), the quotes are NOT stripped out. I believe you must have created a typo when copying my example into your clipbook. You
        Message 3 of 14 , May 25, 2000
          Jody <KJB1611@...> wrote:
          >Hi Wayne & Igor,
          >
          > >> ^!SET %V%=^$GetSelection$
          > >> ^!InsertText ^%V%
          > >> ""Select this sentense with "quotes" and run the above clip""
          >
          > > Try this instead:
          > >
          > > ^!SET %V%="^$GetSelection$"
          > > ^!InsertText "^%V%"
          > >
          > > In the clip language, it is best always to use quotes around strings.
          >
          >I don't think so when using InsertText; it really should not
          >matter. Your example also strips a set of quotes out. Try
          >the following on these with the quotes:
          >
          >""Test This.""

          With my example (as shown above), the quotes are NOT
          stripped out. I believe you must have created a typo
          when copying my example into your clipbook.

          You need quotes around ALL strings in the clip language,
          including with SET and InsertText, in order to prevent
          pairs of quotes from being lost from the string itself.

          The reason Igor lost TWO pairs of quotes with his clip is
          that one pair was lost from not using quotes with ^!Set,
          and the other pair was lost from not using quotes with
          ^!InsertText.

          Try his original example with many quotes:

          """"""whatever text""""""

          to verify that one pair of quotes is lost each time the
          string is referred to without quotes around it in the clip.
          Again, it doesn't matter what the clip command or function
          is, they all work the same way as far as this matters.














          >
          >^!SET %V%=^$GetSelection$
          >^!InsertText "^%V%"
          >
          >Now try this on it:
          >
          >^!SET %V%=^$GetSelection$
          >^!InsertText ""^%V%""
          >
          >Actually, I think it should be that if quotes are used with
          >InsertText that they are treated as literals. The reason for me
          >thinking that way is they are text and NoteTab knows that
          >everything following the command is to be inserted. There is no
          >delimiter needed. That is the way TextToFile works.
          >
          >I never use quotes around my InsertText and have never seen a
          >problem until now and in this case it can be worked around if
          >need be. Help does not show they are required, nor does it give
          >it as an option, not to say they cannot be used though.
          >
          >^!InsertText Any text with tokens (^p/^t)
          >
          >I built a Clip a few weeks ago that required a double quote for
          >what seemed to be a needed a work-around. I'll see if I can find
          >it.
          >
          >Try quotes around the second have of TextToFile sometime. :)
          >
          >^!TextToFile "FileName" AnyText
          >
          >Happy Clip'n!
          >Jody
          >
          >http://www.sureword.com/notetab
          >
          >Subscribe, UnSubscribe, Options
          >mailto:Ntb-Clips-Subscribe@...
          >mailto:Ntb-Clips-UnSubscribe@...
          >http://www.egroups.com/group/ntb-clips
          >
          >
          >------------------------------------------------------------------------
          >Old school buds here:
          >http://click.egroups.com/1/4057/6/_/2798/_/959224137/
          >------------------------------------------------------------------------
          >
          >

          --
          Wayne M. VanWeerthuizen
          Homepage: http://landru.myhome.net/wayne
        • Jody
          Hi Wayne, ... Yes, there was a typo during testing different Clips. ... No, that is not correct. Run this with and without the quotes around ^$GetText$ on the
          Message 4 of 14 , May 25, 2000
            Hi Wayne,

            > I believe you must have created a typo when copying my example
            > into your clipbook.

            Yes, there was a typo during testing different Clips.

            > You need quotes around ALL strings in the clip language,
            > including with SET and InsertText, in order to prevent pairs of
            > quotes from being lost from the string itself.

            No, that is not correct.

            Run this with and without the quotes around ^$GetText$ on the
            following in a file. Do it with and without a blank line under it:

            ""Test""

            H=No Quotes around string, else error
            ^!TextToFile "^$GetAppPath$DeleteMe.txt" "^$GetText$"
            ^!Open "^$GetAppPath$DeleteMe.txt"

            ^!InsertText does not require quotes.
            ^!Set does not require quotes.

            It does in Igor's case and I will explain why on the beta list.

            > Try his original example with many quotes:
            >
            > """"""whatever text""""""
            >
            > to verify that one pair of quotes is lost each time the string
            > is referred to without quotes around it in the clip.

            Yes, it will loose a set each time and I will explain why on
            the beta list. ;) I have some other stuff to take care of first
            though so it might not be until later tonight.

            Happy Clip'n!
            Jody

            http://www.sureword.com/notetab

            Subscribe, UnSubscribe, Options
            mailto:Ntb-Clips-Subscribe@...
            mailto:Ntb-Clips-UnSubscribe@...
            http://www.egroups.com/group/ntb-clips
          • Jody
            Hi Wayne, Igor, and Clippers, I made a long post to the beta list, but felt I should admit an oversight and point out some things to get the record straight on
            Message 5 of 14 , May 26, 2000
              Hi Wayne, Igor, and Clippers,

              I made a long post to the beta list, but felt I should admit an
              oversight and point out some things to get the record straight on
              this list.

              I will leave this next statement as is.

              ^!InsertText does not require quotes.

              I am changing this from:
              ^!Set does not require quotes.

              To:
              ^!Set in almost all cases and for everyday purposes as far as I
              can see does not need quotes.

              You will not find many, if any at all, in any of NoteTab's
              Libraries, at least the five or so I checked. There was one
              place, but they were needed to pass on to DOS in the Compare
              files script.

              There is one case dealing with ^!Set which I overlooked, but it
              has nothing to do with ""Test"" (quotes). When ^!Set is used
              NoteTab does consider that there may be additional variables to
              be set on the same line of instruction so it looks for "; %" or
              ";%" and if not found, then the string is considered as one.

              Both these will only return: test
              ^!Set %t%=test; %test
              ^!Info ^%t%

              ^!Set %t%=test;%test
              ^!Info ^%t%

              Both these will return it all:
              ^!Set %t%="test; %test"
              ^!Info ^%t%

              ^!Set %t%="test;%test"
              ^!Info ^%t%

              The reason the first "failed" is because NoteTab saw the only
              delimiter it looks for. It has nothing to do with quotes and the
              chance of finding "; %" in text is about the same as me going to
              Canada this summer. And, If I did go, I would know I was there.
              Likewise with "; %". It would not be hard at all to isolate
              should it ever occur.

              Wayne wrote:

              > You need quotes around ALL strings in the clip language,
              > including with SET and InsertText, in order to prevent pairs of
              > quotes from being lost from the string itself.

              If you look at all NoteTab's Libraries you will not find, at
              least in the ones I checked, a single case where Eric uses quotes
              in ^!InsertText. "ALL" strings needing quotes is not true at all
              and in fact will cause unwanted effects of the quotes being
              counted as part of the string in at least three places:
              ^!TextToFile, ^!InsertHTML, and ^!InsertWizardHTML. All three of
              those will indeed print the quotes. You can test that in the
              HTML Library and the Body Clip.

              All three Inserts and TextToFile all have one thing in common:
              all of them only have one parameter unlike ^!Set being able to
              have more. NoteTab knows in the places where there is only one
              parameter not to look for another and in the case with the above
              commands everything is considered as one.

              Happy Clip'n!
              Jody

              http://www.sureword.com/notetab

              Subscribe, UnSubscribe, Options
              mailto:Ntb-Clips-Subscribe@...
              mailto:Ntb-Clips-UnSubscribe@...
              http://www.egroups.com/group/ntb-clips
            • Wayne VanWeerthuizen
              ... Yes it does. Given quotes, it works correctly in all known circumstances. Without the quotes, it fails in a known case. If there is a chance that the
              Message 6 of 14 , May 26, 2000
                Jody <KJB1611@...> wrote:

                >Hi Wayne, Igor, and Clippers,
                >
                >I made a long post to the beta list, but felt I should admit an
                >oversight and point out some things to get the record straight on
                >this list.
                >
                >I will leave this next statement as is.
                >
                >^!InsertText does not require quotes.

                Yes it does. Given quotes, it works correctly in all known
                circumstances. Without the quotes, it fails in a known case. If
                there is a chance that the string itself may have quotes in both the
                first and last positions, ^!InsertText requires quotes. You may get
                away with not having them, only if you can be sure this will not
                happen. It is safe to always include them.

                >^!Set in almost all cases and for everyday purposes as far as I
                >can see does not need quotes.

                You are right that omitting quotes will usually not be of much
                consequence. But "almost all cases" is going to far. The
                exceptions, while occasional, occur often enough to be of
                significance.

                >There is one case dealing with ^!Set which I overlooked, but it
                >has nothing to do with ""Test"" (quotes). When ^!Set is used
                >NoteTab does consider that there may be additional variables to
                >be set on the same line of instruction so it looks for "; %" or
                >";%" and if not found, then the string is considered as one.

                So we have two known situations where ^!Set fails to work when
                quotes are omitted, and zero known situations where having quotes
                causes it to fail. So why not just stay in the habit of always
                using quotes with it?

                >Wayne wrote:
                >
                > > You need quotes around ALL strings in the clip language,
                > > including with SET and InsertText, in order to prevent pairs of
                > > quotes from being lost from the string itself.
                >
                >If you look at all NoteTab's Libraries you will not find, at
                >least in the ones I checked, a single case where Eric uses quotes
                >in ^!InsertText.

                That doesn't matter, since we've found a proven case where
                ^!InsertText fails when the quotes are omitted, and we've found zero
                countercases where the use of quotes with ^!InsertText causes it to
                fail. Quotes should be used with ^!InsertText, if the content is a
                arbitrary string. Using quotes with ^!InsertText is the safer
                approach.

                >"ALL" strings needing quotes is not true at all
                >and in fact will cause unwanted effects of the quotes being
                >counted as part of the string in at least three places:
                >^!TextToFile, ^!InsertHTML, and ^!InsertWizardHTML. All three of
                >those will indeed print the quotes. You can test that in the
                >HTML Library and the Body Clip.

                At this point, I do have to admit I was wrong.

                I was expecting NoteTab to be consistent in this regard, but now I
                see that it is not. I guess that until Eric fixes this (if it is
                even a good idea to fix it) we will need to track, on a case-by-case
                basis, which commands sometimes fail when quotes are omitted, and
                which fail when extra quotes are given.

                >All three Inserts and TextToFile all have one thing in common:
                >all of them only have one parameter unlike ^!Set being able to
                >have more. NoteTab knows in the places where there is only one
                >parameter not to look for another and in the case with the above
                >commands everything is considered as one.

                Of the commands that take a single parameter, we know that some
                behave one way, and some behave the other way. Some will lose
                quotes from the data if quotes are not given in the command, others
                will not allow quotes in the command. It now appears to me that we
                will need to learn these on a case-by-case basis.

                --
                Wayne M. VanWeerthuizen
                Homepage: http://landru.myhome.net/wayne
              • Charles M. Raine
                Hi Wayne & Jody: ... It seems to me, at this point in time, we need a definitive response from the Master himself, as to his intention in this matter. That
                Message 7 of 14 , May 26, 2000
                  Hi Wayne & Jody:

                  At 07:36 PM 5/26/2000 -0700, you wrote:
                  >Jody <KJB1611@...> wrote:
                  > >All three Inserts and TextToFile all have one thing in common:
                  > >all of them only have one parameter unlike ^!Set being able to
                  > >have more. NoteTab knows in the places where there is only one
                  > >parameter not to look for another and in the case with the above
                  > >commands everything is considered as one.

                  Wayne wrote:


                  >Of the commands that take a single parameter, we know that some
                  >behave one way, and some behave the other way. Some will lose
                  >quotes from the data if quotes are not given in the command, others
                  >will not allow quotes in the command. It now appears to me that we
                  >will need to learn these on a case-by-case basis.
                  It seems to me, at this point in time, we need a definitive response from
                  the Master himself, as to his intention in this matter. That will be the
                  ultimate determining factor it this case... (With due respect to both Jody
                  and Wayne).
                  Charlie.

                  Charles M. Raine Home Page: http://www.escape.ca/~rainec
                  Phone (204) 895-0940 ICQ # 300058
                  Winnipeg, Manitoba, Canada
                • Eric G.V. Fookes
                  Hi Charlie and Wayne, Sorry for the delay in sending this reply. I ve been held back from work these past two weeks by a very persistent flu. Only just
                  Message 8 of 14 , May 30, 2000
                    Hi Charlie and Wayne,

                    Sorry for the delay in sending this reply. I've been held back from work
                    these past two weeks by a very persistent flu. Only just starting to
                    recover now. See my comment below...

                    > >Of the commands that take a single parameter, we know that some
                    > >behave one way, and some behave the other way. Some will lose
                    > >quotes from the data if quotes are not given in the command, others
                    > >will not allow quotes in the command. It now appears to me that we
                    > >will need to learn these on a case-by-case basis.
                    >It seems to me, at this point in time, we need a definitive response from
                    >the Master himself, as to his intention in this matter. That will be the
                    >ultimate determining factor it this case... (With due respect to both Jody
                    >and Wayne).

                    I agree that the way quotes are currently used in the Clip language can be
                    confusing and may seem inconsistent. Clips were not originally designed to
                    be programmable, but as a result of popular requests, they have gained
                    considerable sophistication. This has not always been easy, especially as I
                    tried to preserve backward compatibility as much as possible. Now, I feel
                    that the Clip language can only be improved by redesigning it from scratch.

                    So... I will be rewriting the Clip parser in NoteTab 5.0 and remove all the
                    confusing issues concerning the syntax. My aim will be to improve the
                    parser speed and reliability, make the syntax more consistent, and offers
                    methods to escape delimiter characters such as quotes and semi-colons.
                    There might be some backward-compatibility issues when I do this, though I
                    will do my best to minimize these.


                    Regards,
                    Eric Fookes
                    -----------
                    Support NoteTab by casting your vote at ...
                    http://www.zdnet.com/downloads/sia/pchoice.html
                    (specify NoteTab Pro, Std, or Light)







                    .
                    .
                    .
                  • Michael Gerholdt
                    From: Eric G.V. Fookes ... scratch. ... the ... As an eternal newbie, lack of backwards compatibility will probably go
                    Message 9 of 14 , May 30, 2000
                      From: "Eric G.V. Fookes

                      <snippers mode="active">

                      >Now, I feel
                      > that the Clip language can only be improved by redesigning it from
                      scratch.
                      >
                      > So... I will be rewriting the Clip parser in NoteTab 5.0 and remove all
                      the
                      > confusing issues concerning the syntax.

                      </snippers>


                      As an eternal newbie, lack of backwards compatibility will probably go right
                      over my head.

                      However, if there is a virtual 'total re-write' in mind here, I wonder if a
                      major shift to perl might not be something to consider. To use perl as the
                      basic clip lingo with some specific NoteTab functions/modules would mean:

                      - NoteTab users would be learning/using a scripting language which is useful
                      both in and out of NoteTab
                      - non-users "out there" who know perl might find this a strong selling point
                      - non-users "out there" who don't know perl might also since this would be a
                      reinforcing environment in which to learn/use perl which they really would
                      like to know anyway
                      - the more folks "out there" like and use NoteTab .... well, that's good for
                      NoteTab

                      - the only folks who might be reluctant would be those who don't know other
                      scripting languages or have a need to do so, and who have worked hard to
                      learn and employ the present scripting language. But - they could just stick
                      with NTP 4.8. :)

                      I don't know if such a thing is possible or if it would be of interest. I
                      just find myself having to learn lots of different things, and whenever I
                      can learn something with exponential application possibilities, I appreciate
                      it greatly.

                      Mike
                    • Eric G.V. Fookes
                      Hi Mike, ... Thanks for your suggestion. Unfortunately, Perl has two major disadvantages compared to the Clip language. First of all, you cannot mix Perl code
                      Message 10 of 14 , May 30, 2000
                        Hi Mike,

                        >As an eternal newbie, lack of backwards compatibility will probably go right
                        >over my head.
                        >
                        >However, if there is a virtual 'total re-write' in mind here, I wonder if a
                        >major shift to perl might not be something to consider. To use perl as the
                        >basic clip lingo with some specific NoteTab functions/modules would mean:

                        Thanks for your suggestion. Unfortunately, Perl has two major disadvantages
                        compared to the Clip language. First of all, you cannot mix Perl code with
                        plain text. Try, for example, designing sophisticated templates with this
                        limitation <g>. Secondly, Perl is a lot harder to learn for someone who has
                        no, or little, programming experience. With the Clip language, you can
                        start at a very basic level and produce some pretty sophisticated tasks.


                        Regards,
                        Eric Fookes
                        -----------
                        Support NoteTab by casting your vote at ...
                        http://www.zdnet.com/downloads/sia/pchoice.html
                        (specify NoteTab Pro, Std, or Light)







                        .
                        .
                        .
                      • Michael Gerholdt
                        ... that would be a drawback . . .
                        Message 11 of 14 , May 30, 2000
                          > First of all, you cannot mix Perl code with
                          > plain text. Try, for example, designing sophisticated templates with this
                          > limitation <g>.

                          that would be a drawback . . .
                          :-]
                        Your message has been successfully submitted and would be delivered to recipients shortly.