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

Re: [Clip] clip to number rows

Expand Messages
  • Dave
    Hi the clip itself works selected text or not but tried it on a short text 5000 lines ,it does 1000 lines no problem but then heads straight to the bottom of
    Message 1 of 27 , Dec 29, 2007
    • 0 Attachment
      Hi
      the clip itself works selected text or not but tried it on a short text 5000
      lines ,it does 1000 lines no problem but then heads straight to the "bottom"
      of the page ,should it not stop when it is finished at 1000 lines ??
      THANKYOU DAVE M


      ----- Original Message -----
      From: "Flo" <flo.gehrke@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Sunday, December 30, 2007 2:12 AM
      Subject: Re: [Clip] clip to number rows


      > --- In ntb-clips@yahoogroups.com, "Dave" <dmc43959@...> wrote:
      >>
      >> Hi
      >> works well ,anyway of stopping it going to the end of the page if
      > you only
      >> do the top half. ?
      >> THANKYOU DAVE M
      >
      > Dave,
      >
      > If no text is selected the Menu Command numbers all lines. If we
      > select lines manually before starting the clip, the numbering will be
      > limited to selected parts only. So we could write...
      >
      > ^!IfFalse=^$GetSelSize$ Next Else Skip
      > ^!Select All
      > ^!Menu Modify/Lines/Number Lines
      > ^!Replace "(^|(?<=\x20))\x20" >> "0" AWRS
      >
      > Regards,
      > Flo
      >
      >
      >
      >
      > Fookes Software: http://www.fookes.com/
      > Fookes Software Discussion Lists: http://www.fookes.com/groups.php
      > Yahoo! Groups Links
      >
      >
      >
      >
    • WV-Mike
      ... Hi Flo, Groovy clip! Can it be modified so the Start numbering from... dialog does not run and it automatically starts with 1 ? Thanks, -Mike [Non-text
      Message 2 of 27 , Dec 29, 2007
      • 0 Attachment
        At 10:12 AM 12/29/2007 , you wrote:
        >Dave,
        >
        >If no text is selected the Menu Command numbers all lines. If we
        >select lines manually before starting the clip, the numbering will be
        >limited to selected parts only. So we could write...
        >
        >^!IfFalse=^$GetSelSize$ Next Else Skip
        >^!Select All
        >^!Menu Modify/Lines/Number Lines
        >^!Replace "(^|(?<=\x20))\x20" >> "0" AWRS
        >
        >Regards, Flo

        Hi Flo,

        Groovy clip! Can it be modified so the "Start numbering from..." dialog
        does not run and it automatically starts with "1"?

        Thanks,
        -Mike

        [Non-text portions of this message have been removed]
      • Don - HtmlFixIt.com
        ... Hi, In the first one it is this -- All one line is this: ^!InsertText ^$StrFill( 0 ;^$Calc(^%numberlength%-^$StrSize( ^%counter% )$)$)$^%counter%. So
        Message 3 of 27 , Dec 29, 2007
        • 0 Attachment
          Axel Berger wrote:
          > WV-Mike wrote:
          >> but I cannot see where the problem is.
          >
          > There is a newline before the closing quote in the line with ^$StrFill
          > and that whole line belongs into the one above after ^!InsertText
          >
          > Axel
          >
          Hi,

          In the first one it is this --
          All one line is this:
          ^!InsertText
          "^$StrFill("0";^$Calc(^%numberlength%-^$StrSize("^%counter%")$)$)$^%counter%.

          "

          So should be ***all on one line between the asterisks***:
          ***^!InsertText
          "^$StrFill("0";^$Calc(^%numberlength%-^$StrSize("^%counter%")$)$)$^%counter%.
          "***

          And in the second rendition it is that this is three lines, not one:
          ^!Set
          %numberlength%="^$Calc(^$StrSize("^$Calc(^%end%-^%start%)$")$)$"^!Jump
          Select_Start^!Jump Line_Start

          The last two things that start with ^! go on their own lines.

          Let us know how it goes.

          Flo, when I said where to manually set the delimiter I meant like in an
          ini file or something. I found it under options menu. But I suspect
          there is a file somewhere that I could have the clip edit to change it
          to a different delimiter without having to fiddle with the options menu.
          Does that makes sense. I have never enjoyed watching a washing
          machine ... but this machine I do. Can't explain my fascination :-)

          Don
        • WV-Mike
          Hey Don, It took both you and Axel pointing this out before I finally saw it. Sheesh! Works great. Thanks, -Mike ... [Non-text portions of this message have
          Message 4 of 27 , Dec 29, 2007
          • 0 Attachment
            Hey Don,

            It took both you and Axel pointing this out before I finally saw it.
            Sheesh!

            Works great.

            Thanks,
            -Mike
            ------------------------
            At 02:33 PM 12/29/2007 , you wrote:
            >Hi,
            >In the first one it is this --
            >All one line is this:
            >^!InsertText
            >"^$StrFill("0";^$Calc(^%numberlength%-^$StrSize("^%counter%")$)$)$^%counter%.
            >
            >"
            >
            >So should be ***all on one line between the asterisks***:
            >***^!InsertText
            >"^$StrFill("0";^$Calc(^%numberlength%-^$StrSize("^%counter%")$)$)$^%counter%.
            >"***
            >
            >And in the second rendition it is that this is three lines, not one:
            >^!Set
            >%numberlength%="^$Calc(^$StrSize("^$Calc(^%end%-^%start%)$")$)$"^!Jump
            >Select_Start^!Jump Line_Start
            >
            >The last two things that start with ^! go on their own lines.
            >
            >Let us know how it goes.


            [Non-text portions of this message have been removed]
          • Flo
            @Sheri wrote... ... Yes, Sheri, there may be good reasons to protect double spaces inside the text. According with your proposal, the new version replaces
            Message 5 of 27 , Dec 30, 2007
            • 0 Attachment
              @Sheri wrote...

              > ...maybe it would be better to replace those spaces with
              > something else (e.g., nonbreaking spaces) and put them back
              > after the fact, rather than just compressing them to single
              > spaces.

              Yes, Sheri, there may be good reasons to protect double spaces inside
              the text. According with your proposal, the new version replaces
              double spaces with Hex A0 and restores them later on.

              The ^!Replace Command removes any selection we have made before
              starting the clip (in order to limit the numbering to certain lines).
              Consequently, all lines will get numbered. To avoid this, I've added
              some commands that restore selections.

              @Dave wrote...

              > it does 1000 lines no problem but then heads straight to the
              > "bottom" of the page, should it not stop when it is finished at
              > 1000 lines ??

              The numbering is limited to selected lines but the ^!Replace Command
              checks all lines. That's why the the clip is scrolling down to the
              end of the document. Trying to avoid this wouldn't measurably speed
              up the clip. Now the last command line will bring you back to the
              first numbered line.

              @Mike wrote...

              > Groovy clip! Can it be modified so the "Start numbering
              > from..." dialog does not run and it automatically starts with "1"?

              See that ^Keyboard Command in my reply to Don! That's the only way I
              can figure out to override that prompt. I didn't add that to the last
              version because I think it's a quite useful option.

              --- Latest version ---

              ; Number all lines or selected lines
              ^!Set %SelectionSize%=^$GetSelSize$
              ^!IfFalse=^%SelectionSize% Skip_2 Else Next
              ^!Set %SelectionStart%=^$GetRowStart$:^$GetColStart$
              ^!Set %SelectionEnd%=^$GetRowEnd$:^$GetColEnd$
              ;-- Protect double spaces
              ^!Replace "\x20\x20" >> "\xA0\xA0" AWRS
              ^!IfFalse=^%SelectionSize% Next Else Skip_2
              ^!Select All
              ^!Goto Skip_2
              ^!SetCursor ^%SelectionStart%
              ^!SelectTo ^%SelectionEnd%
              ;--Number lines
              ^!Menu Modify/Lines/Number Lines
              ;--Replace leading spaces with zero
              ^!Replace "(^|(?<=\x20))\x20" >> "0" AWRS
              ;-- Restore double spaces
              ^!Replace "\xA0\xA0" >> "\x20\x20" AWRS
              ^!SetCursor ^%SelectionStart%


              Regards,
              Flo
               
            • WV-Mike
              ... Thanks, Flo! -Mike [Non-text portions of this message have been removed]
              Message 6 of 27 , Dec 30, 2007
              • 0 Attachment
                At 10:42 AM 12/30/2007 , you wrote:
                > > Groovy clip! Can it be modified so the "Start numbering
                > > from..." dialog does not run and it automatically starts with "1"?
                >
                >See that ^Keyboard Command in my reply to Don! That's the only way I
                >can figure out to override that prompt. I didn't add that to the last
                >version because I think it's a quite useful option.


                Thanks, Flo!
                -Mike


                [Non-text portions of this message have been removed]
              • Flo
                Don wrote... ... I think this is controlled by... NbrSeparator= . in the [Options] Section of the INI-file. Normally, we should be able to change that
                Message 7 of 27 , Dec 30, 2007
                • 0 Attachment
                  Don wrote...

                  > Flo, when I said where to manually set the delimiter I meant
                  > like in an ini file or something. I found it under options
                  > menu. But I suspect there is a file somewhere that I could
                  > have the clip edit to change it to a different delimiter
                  > without having to fiddle with the options menu.

                  I think this is controlled by...

                  NbrSeparator=". "

                  in the [Options] Section of the INI-file. Normally, we should be able
                  to change that setting (to ": " for example) with...

                  ^!SaveValue Options:NbrSeparator=": "

                  But for me this command doesn't really affect that setting. I don't
                  know what's wrong with that.

                  As a work-around it works with...

                  ^!KeyboardDelay 50
                  ^!Keyboard ALT+V O SHIFT+TAB RIGHT ALT+U #: # ENTER

                  Probably, that's not the most elegant solution...

                  By the way -- may I point out the following lines in your clips...

                  ^!Set %numberlength%="^$Calc(^$StrSize("^$GetLineCount$")$)$"

                  I think there's nothing to calculate in here. You could write...

                  ^!Set %numberlength%=^$StrSize(^$GetLineCount$)$

                  to get the same result.

                  Similar to that, you could reduce...

                  ^!Set %numberlength%="^$Calc(^$StrSize("^$Calc(^%end%-^%start%)$")$)$"

                  to...

                  ^!Set %numberlength%=^$StrSize(^$Calc(^%end%-^%start%)$)$

                  Maybe, this could save us some more milliseconds ;-)

                  Regards,
                  Flo
                   
                • Sheri
                  ... You can change NoteTab s options with clips, but before making a change you need ^!ProginiSave, and after the change you need ^!ProgIniLoad. So:
                  Message 8 of 27 , Dec 30, 2007
                  • 0 Attachment
                    Flo wrote:
                    > Don wrote...
                    >
                    >
                    >> Flo, when I said where to manually set the delimiter I meant
                    >> like in an ini file or something. I found it under options
                    >> menu. But I suspect there is a file somewhere that I could
                    >> have the clip edit to change it to a different delimiter
                    >> without having to fiddle with the options menu.
                    >>
                    >
                    > I think this is controlled by...
                    >
                    > NbrSeparator=". "
                    >
                    > in the [Options] Section of the INI-file. Normally, we should be able
                    > to change that setting (to ": " for example) with...
                    >
                    > ^!SaveValue Options:NbrSeparator=": "
                    >
                    > But for me this command doesn't really affect that setting. I don't
                    > know what's wrong with that.
                    >
                    You can change NoteTab's options with clips, but before making a change
                    you need ^!ProginiSave, and after the change you need ^!ProgIniLoad.

                    So:

                    ^!ProgIniSave
                    ^!SaveValue Options:NbrSeparator=": "
                    ^!ProgIniLoad

                    will immediately cause the number separator option to change to colon space

                    Regards,
                    Sheri
                  • Flo
                    Sorry for... ^!IfFalse=^%SelectionSize% Skip_2 Else Next Obviously, NT5 tolerates that wrong equal sign, but that s no clean code. Thanks to Sheri for that
                    Message 9 of 27 , Dec 30, 2007
                    • 0 Attachment
                      Sorry for...

                      ^!IfFalse=^%SelectionSize% Skip_2 Else Next

                      Obviously, NT5 tolerates that wrong equal sign, but that's no clean
                      code. Thanks to Sheri for that hint!

                      Regards,
                      Flo

                      --- Latest version ---

                      ; Number all lines or selected lines
                      ^!Set %SelectionSize%=^$GetSelSize$
                      ^!IfFalse ^%SelectionSize% Skip_2 Else Next
                      ^!Set %SelectionStart%=^$GetRowStart$:^$GetColStart$
                      ^!Set %SelectionEnd%=^$GetRowEnd$:^$GetColEnd$
                      ;-- Protect double spaces
                      ^!Replace "\x20\x20" >> "\xA0\xA0" AWRS
                      ^!IfFalse ^%SelectionSize% Next Else Skip_2
                      ^!Select All
                      ^!Goto Skip_2
                      ^!SetCursor ^%SelectionStart%
                      ^!SelectTo ^%SelectionEnd%
                      ;--Number lines
                      ^!Menu Modify/Lines/Number Lines
                      ;--Replace leading spaces with zero
                      ^!Replace "(^|(?<=\x20))\x20" >> "0" AWRS
                      ;-- Restore double spaces
                      ^!Replace "\xA0\xA0" >> "\x20\x20" AWRS
                      ^!SetCursor ^%SelectionStart%
                    • Flo
                      ... change ... Thank you, Sheri, that s working fine. So we could even start the numbering with a Wizard that allows to choose from different delimiters, and
                      Message 10 of 27 , Dec 31, 2007
                      • 0 Attachment
                        --- In ntb-clips@yahoogroups.com, Sheri <silvermoonwoman@...> wrote:
                        >
                        > You can change NoteTab's options with clips, but before making a
                        change
                        > you need ^!ProginiSave, and after the change you need ^!ProgIniLoad...

                        Thank you, Sheri, that's working fine. So we could even start the
                        numbering with a Wizard that allows to choose from different
                        delimiters, and finally return to a default setting...

                        Flo
                         
                      • Don - HtmlFixIt.com
                        ... That was my original thought Flo. In fact you could (if you wish) have a default set in your wizard and offer choices much like Jody s old Noteblock clips
                        Message 11 of 27 , Jan 2, 2008
                        • 0 Attachment
                          Flo wrote:
                          > --- In ntb-clips@yahoogroups.com, Sheri <silvermoonwoman@...> wrote:
                          >> You can change NoteTab's options with clips, but before making a
                          > change
                          >> you need ^!ProginiSave, and after the change you need ^!ProgIniLoad...
                          >
                          > Thank you, Sheri, that's working fine. So we could even start the
                          > numbering with a Wizard that allows to choose from different
                          > delimiters, and finally return to a default setting...
                          >
                          > Flo
                          >
                          That was my original thought Flo. In fact you could (if you wish) have
                          a default set in your wizard and offer choices much like Jody's old
                          Noteblock clips do for various things. I suppose you could even use a
                          custom ini that saves your selections from use to use but then puts them
                          in the main ini.

                          Good point of the extra calcs. I think I originally thought I would
                          have to do line math and in the end found a function to tell me the
                          length or something and never bailed on the former method completely or
                          something.
                        Your message has been successfully submitted and would be delivered to recipients shortly.