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

StrPosRight bug in NTP 7.0?

Expand Messages
  • anachromat
    Downloaded NTP 7.0 today, and some old clips went crazy. Tracked it down to this: H=bug ^!Info ^$StrPosRight( X ; abcXdefXghi ;False)$ That displays 4 when I
    Message 1 of 17 , Jul 4, 2012
    • 0 Attachment
      Downloaded NTP 7.0 today, and some old clips went crazy. Tracked it down to this:

      H=bug
      ^!Info ^$StrPosRight("X";"abcXdefXghi";False)$

      That displays 4 when I run it (the index of the leftmost X). I expected it to display 8 (the index of the rightmost X). In other words, StrPosRight is acting the same as StrPos now.
    • Alec Burgess
      Try: ^!Info ^$StrPosRight( X ; abcDXdefXghi ;False)$ ie. different number of characters from left and right before the targeted character Not tested in ntb7
      Message 2 of 17 , Jul 4, 2012
      • 0 Attachment
        Try: ^!Info ^$StrPosRight("X";"abcDXdefXghi";False)$
        ie. different number of characters from left and right before the
        targeted character
        Not tested in ntb7 nor any earlier version, but it makes sense to me.
        If fact it used to behave differently I would almost say it was a bug
        then not now.
        To get how many characters the rightmost match is from the start I think
        you would have to subtract the result from the length of the string.

        On 2012-07-04 22:34, anachromat wrote:
        > Downloaded NTP 7.0 today, and some old clips went crazy. Tracked it
        > down to this:
        >
        > H=bug
        > ^!Info ^$StrPosRight("X";"abcXdefXghi";False)$
        >
        > That displays 4 when I run it (the index of the leftmost X). I
        > expected it to display 8 (the index of the rightmost X). In other
        > words, StrPosRight is acting the same as StrPos now.
      • anachromat
        [Alec Burgess] ... That example returns 5 in NTP 7.0, same as StrPos returns. ... It certainly makes sense for StrPos. But StrPosRight is documented as
        Message 3 of 17 , Jul 4, 2012
        • 0 Attachment
          [Alec Burgess]
          > Try: ^!Info ^$StrPosRight("X";"abcDXdefXghi";False)$
          > ie. different number of characters from left and right before the
          > targeted character.

          That example returns 5 in NTP 7.0, same as StrPos returns.


          > Not tested in ntb7 nor any earlier version, but it
          > makes sense to me.

          It certainly makes sense for StrPos. But StrPosRight is documented as searching "from right to left".


          > If fact it used to behave differently

          Yes, it did. It used to work as documented - LOL ;-)

          > ...
        • Alec Burgess
          Hmmm ... now that DOES sound awfully hard to pass off as that s a feature not a bug :-D Maybe Eric is still monitoring the forum closely and can weigh in?
          Message 4 of 17 , Jul 4, 2012
          • 0 Attachment
            Hmmm ... now that DOES sound awfully hard to pass off as "that's a
            feature not a bug" :-D
            Maybe Eric is still monitoring the forum closely and can weigh in?

            btw: Eric, your new pages and in fact the entire site looks really good.
            Please post here when you have the "contributed clips" moved over. One
            minor point: You might want to link the first and subsequent references
            to user-support-groups to your page with the links to these yahoo groups.

            On 2012-07-04 23:54, anachromat wrote:
            > [Alec Burgess]
            > > Try: ^!Info ^$StrPosRight("X";"abcDXdefXghi";False)$
            > > ie. different number of characters from left and right before the
            > > targeted character.
            >
            > That example returns 5 in NTP 7.0, same as StrPos returns.
            >
            > > Not tested in ntb7 nor any earlier version, but it
            > > makes sense to me.
            >
            > It certainly makes sense for StrPos. But StrPosRight is documented as
            > searching "from right to left".
            >
            > > If fact it used to behave differently
            >
            > Yes, it did. It used to work as documented - LOL ;-)
          • Don
            One page says you were the first tabbed text editor way back in 1995 ... and the copyrights are from 1996 and everywhere else says you started in 1996. Also
            Message 5 of 17 , Jul 5, 2012
            • 0 Attachment
              One page says you were the first tabbed text editor way back in 1995 ...
              and the copyrights are from 1996 and everywhere else says you started in
              1996.

              Also how does one fine their purchase key? I have no idea. I tried to
              buy and got stuck.

              On 7/5/2012 12:09 AM, Alec Burgess wrote:
              > Hmmm ... now that DOES sound awfully hard to pass off as "that's a
              > feature not a bug" :-D
              > Maybe Eric is still monitoring the forum closely and can weigh in?
              >
              > btw: Eric, your new pages and in fact the entire site looks really good.
              > Please post here when you have the "contributed clips" moved over. One
              > minor point: You might want to link the first and subsequent references
              > to user-support-groups to your page with the links to these yahoo groups.
              >
              > On 2012-07-04 23:54, anachromat wrote:
              >> [Alec Burgess]
              >>> Try: ^!Info ^$StrPosRight("X";"abcDXdefXghi";False)$
              >>> ie. different number of characters from left and right before the
              >>> targeted character.
              >>
              >> That example returns 5 in NTP 7.0, same as StrPos returns.
              >>
              >>> Not tested in ntb7 nor any earlier version, but it
              >>> makes sense to me.
              >>
              >> It certainly makes sense for StrPos. But StrPosRight is documented as
              >> searching "from right to left".
              >>
              >>> If fact it used to behave differently
              >>
              >> Yes, it did. It used to work as documented - LOL ;-)
              >
              >
              > ------------------------------------
              >
              > Fookes Software: http://www.fookes.com/
              > NoteTab website: http://www.notetab.com/
              > NoteTab Discussion Lists: http://www.notetab.com/groups.php
              >
              > ***
              > Yahoo! Groups Links
              >
              >
              >
              >
            • Piotr
              Your old purchased and installed copy of NoteTab is your purchase key. If you click the Upgrade link in the check for updates dialog box it will take you to
              Message 6 of 17 , Jul 5, 2012
              • 0 Attachment
                Your old purchased and installed copy of NoteTab is your purchase key. If
                you click the Upgrade link in the check for updates dialog box it will take
                you to the purchase form. I upgraded yesterday evening without any problems.

                Piotr

                On Thu, Jul 5, 2012 at 12:59 PM, Don <don@...> wrote:

                > **
                >
                >
                > One page says you were the first tabbed text editor way back in 1995 ...
                > and the copyrights are from 1996 and everywhere else says you started in
                > 1996.
                >
                > Also how does one fine their purchase key? I have no idea. I tried to
                > buy and got stuck.
                >
                >
                > On 7/5/2012 12:09 AM, Alec Burgess wrote:
                > > Hmmm ... now that DOES sound awfully hard to pass off as "that's a
                > > feature not a bug" :-D
                > > Maybe Eric is still monitoring the forum closely and can weigh in?
                > >
                > > btw: Eric, your new pages and in fact the entire site looks really good.
                > > Please post here when you have the "contributed clips" moved over. One
                > > minor point: You might want to link the first and subsequent references
                > > to user-support-groups to your page with the links to these yahoo groups.
                > >
                > > On 2012-07-04 23:54, anachromat wrote:
                > >> [Alec Burgess]
                > >>> Try: ^!Info ^$StrPosRight("X";"abcDXdefXghi";False)$
                > >>> ie. different number of characters from left and right before the
                > >>> targeted character.
                > >>
                > >> That example returns 5 in NTP 7.0, same as StrPos returns.
                > >>
                > >>> Not tested in ntb7 nor any earlier version, but it
                > >>> makes sense to me.
                > >>
                > >> It certainly makes sense for StrPos. But StrPosRight is documented as
                > >> searching "from right to left".
                > >>
                > >>> If fact it used to behave differently
                > >>
                > >> Yes, it did. It used to work as documented - LOL ;-)
                > >
                > >
                > > ------------------------------------
                >
                > >
                > > Fookes Software: http://www.fookes.com/
                > > NoteTab website: http://www.notetab.com/
                > > NoteTab Discussion Lists: http://www.notetab.com/groups.php
                > >
                > > ***
                > > Yahoo! Groups Links
                > >
                > >
                > >
                > >
                >
                >
                >


                [Non-text portions of this message have been removed]
              • Don
                Thanks Piotr worked like a charm. Since it was 50% I bought two of them
                Message 7 of 17 , Jul 5, 2012
                • 0 Attachment
                  Thanks Piotr worked like a charm. Since it was 50% I bought two of them
                  :-) and am installing one now.

                  On 7/5/2012 7:31 AM, Piotr wrote:
                  > Your old purchased and installed copy of NoteTab is your purchase key. If
                  > you click the Upgrade link in the check for updates dialog box it will take
                  > you to the purchase form. I upgraded yesterday evening without any problems.
                  >
                  > Piotr
                  >
                • Eric Fookes
                  Hi Don, ... NoteTab and Fookes Software came into existence in 1996. But there was an earlier version of NoteTab called Mini Notepad. It had the tabbed
                  Message 8 of 17 , Jul 5, 2012
                  • 0 Attachment
                    Hi Don,

                    > One page says you were the first tabbed text editor way back in 1995 ...
                    > and the copyrights are from 1996 and everywhere else says you started in
                    > 1996.

                    NoteTab and Fookes Software came into existence in 1996. But there was
                    an earlier version of NoteTab called Mini Notepad. It had the tabbed
                    interface and was released as freeware in 1995.

                    > Also how does one fine their purchase key? I have no idea. I tried to
                    > buy and got stuck.

                    You only need the order number if you can't use NoteTab's "Check for
                    Updates" feature available from the Help menu. If that doesn't work and
                    you can't find your order number, contact our Help Desk and we'll get
                    you sorted out:

                    http://www.notetab.com/contact-us.php

                    --
                    Regards,

                    Eric Fookes
                    http://www.fookes.com/
                  • Eric Fookes
                    Hi Tim, ... Thanks for this bug report. I ve made a note of it and will investigate the issue when preparing the next maintenance release... -- Regards, Eric
                    Message 9 of 17 , Jul 5, 2012
                    • 0 Attachment
                      Hi Tim,

                      > Downloaded NTP 7.0 today, and some old clips went crazy. Tracked it down to this:
                      >
                      > H=bug
                      > ^!Info ^$StrPosRight("X";"abcXdefXghi";False)$
                      >
                      > That displays 4 when I run it (the index of the leftmost X). I expected it to display 8 (the index of the rightmost X). In other words, StrPosRight is acting the same as StrPos now.

                      Thanks for this bug report. I've made a note of it and will investigate
                      the issue when preparing the next maintenance release...

                      --
                      Regards,

                      Eric Fookes
                      http://www.fookes.com/
                    • Eric Fookes
                      Hi Alec, ... Glad you like the new site. It took much longer to complete than expected. I did all I could to help make this release a success. There are still
                      Message 10 of 17 , Jul 5, 2012
                      • 0 Attachment
                        Hi Alec,

                        > btw: Eric, your new pages and in fact the entire site looks really good.

                        Glad you like the new site. It took much longer to complete than
                        expected. I did all I could to help make this release a success. There
                        are still some things under construction. For example, some of the
                        screen shots will be replaced with short videos.

                        > Please post here when you have the "contributed clips" moved over.

                        Will do.

                        > One
                        > minor point: You might want to link the first and subsequent references
                        > to user-support-groups to your page with the links to these yahoo groups.

                        Thanks for your suggestion.

                        --
                        Regards,

                        Eric Fookes
                        http://www.fookes.com/
                      • Axel Berger
                        ... Lucky you. I enforce a minimum font size, no background wallpaper, and disallow scripts, all perfectly legal and standard settings offered by all current
                        Message 11 of 17 , Jul 5, 2012
                        • 0 Attachment
                          Piotr wrote:
                          > I upgraded yesterday evening without any problems.

                          Lucky you. I enforce a minimum font size, no background wallpaper, and
                          disallow scripts, all perfectly legal and standard settings offered by
                          all current browsers, and this is what I see:

                          <http://berger-odenthal.de/upload/Clipboard01.png>
                          <http://berger-odenthal.de/upload/Clipboard02.png>

                          I'm sorry, but this is a dysdunctional, unusable, and broken website. I
                          can't currently upgrade, much that I want to. Shame that.

                          Axel

                          --
                          Dipl.-Ing. F. Axel Berger Tel: +49/ 2174/ 7439 07
                          Johann-Häck-Str. 14 Fax: +49/ 2174/ 7439 68
                          D-51519 Odenthal-Heide eMail: Axel-Berger@...
                          Deutschland (Germany) http://berger-odenthal.de
                        • Eric Fookes
                          Hi Axel, I m sorry to hear you are having issues with our new e-commerce system. I ve sent them a copy of your message to see what they have to say about it.
                          Message 12 of 17 , Jul 5, 2012
                          • 0 Attachment
                            Hi Axel,

                            I'm sorry to hear you are having issues with our new e-commerce system.
                            I've sent them a copy of your message to see what they have to say about
                            it. Were you able to view the new NoteTab site alright with your settings?

                            --
                            Regards,

                            Eric Fookes
                            http://www.fookes.com/


                            On 05/07/2012 17:17, Axel Berger wrote:
                            > Piotr wrote:
                            >> I upgraded yesterday evening without any problems.
                            >
                            > Lucky you. I enforce a minimum font size, no background wallpaper, and
                            > disallow scripts, all perfectly legal and standard settings offered by
                            > all current browsers, and this is what I see:
                            >
                            > <http://berger-odenthal.de/upload/Clipboard01.png>
                            > <http://berger-odenthal.de/upload/Clipboard02.png>
                            >
                            > I'm sorry, but this is a dysdunctional, unusable, and broken website. I
                            > can't currently upgrade, much that I want to. Shame that.
                            >
                            > Axel
                          • Axel Berger
                            ... Sure, you at least value cleanliness, KISS, and standards, so even in my CSS-less and imageless Netscape 4.8 it s fully functional. There are some bugs
                            Message 13 of 17 , Jul 5, 2012
                            • 0 Attachment
                              Eric Fookes wrote:
                              > Were you able to view the new NoteTab site alright with your settings?

                              Sure, you at least value cleanliness, KISS, and standards, so even in my
                              CSS-less and imageless Netscape 4.8 it's fully functional. There are
                              some bugs though:

                              In HTML the reader, not you, decides about font size. This is what
                              happens, when you try to press it into a border of finite pixel size
                              regardless:

                              <http://berger-odenthal.de/upload/Clipboard03.png>

                              Without CSS all browsers leave a small margin between the window frame
                              and the leftmost letters. With CSS and a full reset you're responsible
                              for that yourself. This

                              <http://berger-odenthal.de/upload/Clipboard04.png>

                              is ugly and hard to read.
                              I suggest continuing this in the HTML list, where it isn't off topic.

                              N.B: I'm not sure if the list accepts attachments or not. As they're
                              only 18 kB and 7 kB I'll try attaching the two images.

                              Axel

                              --
                              Dipl.-Ing. F. Axel Berger Tel: +49/ 2174/ 7439 07
                              Johann-Häck-Str. 14 Fax: +49/ 2174/ 7439 68
                              D-51519 Odenthal-Heide eMail: Axel-Berger@...
                              Deutschland (Germany) http://berger-odenthal.de

                              [Non-text portions of this message have been removed]
                            • Piotr
                              I used Google Chrome, and did not disable anything in it. If you don t want to be tracked, you can use the Anonymous mode in it. PB ... [Non-text portions of
                              Message 14 of 17 , Jul 5, 2012
                              • 0 Attachment
                                I used Google Chrome, and did not disable anything in it. If you don't want
                                to be tracked, you can use the Anonymous mode in it.

                                PB

                                On Thu, Jul 5, 2012 at 5:17 PM, Axel Berger <Axel-Berger@...> wrote:

                                > **
                                >
                                >
                                > Piotr wrote:
                                > > I upgraded yesterday evening without any problems.
                                >
                                > Lucky you. I enforce a minimum font size, no background wallpaper, and
                                > disallow scripts, all perfectly legal and standard settings offered by
                                > all current browsers, and this is what I see:
                                >
                                > <http://berger-odenthal.de/upload/Clipboard01.png>
                                > <http://berger-odenthal.de/upload/Clipboard02.png>
                                >
                                > I'm sorry, but this is a dysdunctional, unusable, and broken website. I
                                > can't currently upgrade, much that I want to. Shame that.
                                >
                                > Axel
                                >
                                > --
                                > Dipl.-Ing. F. Axel Berger Tel: +49/ 2174/ 7439 07
                                > Johann-Häck-Str. 14 Fax: +49/ 2174/ 7439 68
                                > D-51519 Odenthal-Heide eMail: Axel-Berger@...
                                > Deutschland (Germany) http://berger-odenthal.de
                                >
                                >
                                >


                                [Non-text portions of this message have been removed]
                              • flo.gehrke
                                ... Same bug in #^$StrPosMid$. Test: ^!Info ^$StrPosMid( X ; abcXdef ;1;True)$ ^!Info ^$StrPosMid( X ; abcXdef ;2;True)$ Different start positions are
                                Message 15 of 17 , Jul 6, 2012
                                • 0 Attachment
                                  --- In ntb-clips@yahoogroups.com, "anachromat" <tim.peters@...> wrote:
                                  >
                                  > Downloaded NTP 7.0 today, and some old clips went crazy. Tracked it down to this:
                                  >
                                  > H=bug
                                  > ^!Info ^$StrPosRight("X";"abcXdefXghi";False)$
                                  >
                                  > That displays 4 when I run it (the index of the leftmost X). I expected it to display 8 (the index of the rightmost X). In other words, StrPosRight is acting the same as StrPos now.


                                  Same bug in #^$StrPosMid$.

                                  Test:

                                  ^!Info ^$StrPosMid("X";"abcXdef";1;True)$
                                  ^!Info ^$StrPosMid("X";"abcXdef";2;True)$

                                  Different start positions are returning the same value. As Tim wrote, it behaves as ^$StrPos$ too.

                                  Regards,
                                  Flo

                                  NT 7.0 Pro Final Release
                                • anachromat
                                  [flo.gehrke] ... Ah, but I believe they _should_, right? There is only one X in the string, at index 4. If you start searching at the first, second, third or
                                  Message 16 of 17 , Jul 6, 2012
                                  • 0 Attachment
                                    [flo.gehrke]
                                    > Same bug in #^$StrPosMid$.
                                    >
                                    > Test:
                                    >
                                    > ^!Info ^$StrPosMid("X";"abcXdef";1;True)$
                                    > ^!Info ^$StrPosMid("X";"abcXdef";2;True)$
                                    >
                                    > Different start positions are returning the same value.

                                    Ah, but I believe they _should_, right? There is only one X in the string, at index 4. If you start searching at the first, second, third or fourth position, that's the X you should find.

                                    Here's a more elaborate test:

                                    ^!Set %m%=^%EMPTY%; %i%=1
                                    :again
                                    ^!Append %m%=at i=^%i% result is ^$StrPosMid("X";"aXaXaXa";^%i%;True)$^P
                                    ^!Inc %i%
                                    ^!If ^%i%>7 NEXT ELSE again
                                    ^!Info [L]^%m%

                                    Under NTP 7.0, that displays:

                                    at i=1 result is 2
                                    at i=2 result is 2
                                    at i=3 result is 4
                                    at i=4 result is 4
                                    at i=5 result is 6
                                    at i=6 result is 6
                                    at i=7 result is 0

                                    and those all look correct to me.
                                  • flo.gehrke
                                    ... Tim, Thanks -- you are certainly right. In my naive view, I thought that ^$StrPosMid$ is shifting the counting of string positions to the right, and the
                                    Message 17 of 17 , Jul 7, 2012
                                    • 0 Attachment
                                      --- In ntb-clips@yahoogroups.com, "anachromat" <tim.peters@...> wrote:

                                      > > ^!Info ^$StrPosMid("X";"abcXdef";1;True)$
                                      > > ^!Info ^$StrPosMid("X";"abcXdef";2;True)$
                                      > >
                                      > > Different start positions are returning the same value.
                                      >
                                      > Ah, but I believe they _should_, right?

                                      Tim,

                                      Thanks -- you are certainly right.

                                      In my naive view, I thought that '^$StrPosMid$' is shifting the counting of string positions to the right, and the specified index position would be the point from where the COUNTING starts. Actually, it's the point from where the SEARCHING starts.

                                      Consequently...

                                      ^!Info Start at position #3 = ^$StrPosMid("X";"12345X7890";3;"1")$
                                      ^!Info Start at position #6 = ^$StrPosMid("X";"12345X7890";6;"1")$

                                      will correctly return the same value '6'. But...

                                      ^!Info Start at position #7 = ^$StrPosMid("X";"12345X7890";7;"1")$

                                      returns '0' because 'X' is not inside the range that is searched.

                                      I hope I learned the lesson now :-)

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