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

clip to number rows

Expand Messages
  • WV-Mike
    Howdy, Anyone out there have a clip which will sequentially number a the rows of hi-lighted text? I tried the ones in the NoteBlock library - Numer lines...
    Message 1 of 27 , Dec 28, 2007
    • 0 Attachment
      Howdy,
      Anyone out there have a clip which will sequentially number a the rows of
      hi-lighted text?
      I tried the ones in the NoteBlock library - "Numer lines..." , "Insert in
      Front of Block with Incrementing Number..."

      However, I could not get them to perform as I wanted:

      I hi-light a block, run the clip and then each line is numbered:

      1. text
      2. text
    • Axel Berger
      ... I d try a two-step process for this. First use a regex to place a marker at the beginning of each line. Then run a loop incrementing a counter and
      Message 2 of 27 , Dec 28, 2007
      • 0 Attachment
        WV-Mike wrote:
        > I hi-light a block, run the clip and then each line is numbered:

        I'd try a two-step process for this. First use a regex to place a marker
        at the beginning of each line. Then run a loop incrementing a counter
        and replacing one occurrance of the marker with the counter value.

        Axel
      • Don - HtmlFixIt.com
        ... So you start at one, not the line number in the document?
        Message 3 of 27 , Dec 28, 2007
        • 0 Attachment
          WV-Mike wrote:
          > Howdy,
          > Anyone out there have a clip which will sequentially number a the rows of
          > hi-lighted text?
          > I tried the ones in the NoteBlock library - "Numer lines..." , "Insert in
          > Front of Block with Incrementing Number..."
          >
          > However, I could not get them to perform as I wanted:
          >
          > I hi-light a block, run the clip and then each line is numbered:
          >
          > 1. text
          > 2. text

          So you start at one, not the line number in the document?
        • Don - HtmlFixIt.com
          ;whacked at by don at htmlfixit.com ^!SetWordWrap Off ;Clear all Variables ^!ClearVariables ;check if something highlighted: ^!If ^$GetSelSize$ 0 skip_2
          Message 4 of 27 , Dec 28, 2007
          • 0 Attachment
            ;whacked at by don at htmlfixit.com
            ^!SetWordWrap Off
            ;Clear all Variables
            ^!ClearVariables

            ;check if something highlighted:
            ^!If "^$GetSelSize$" <> "0" skip_2
            ;next line is long
            ^!Continue This won't work -- you were supposed to highlight something.
            ^!Goto end

            ;get highlight length
            ^!Set %start%="^$GetRowStart$"
            ^!Set %end%="^$GetRowEnd$"


            ;next line is long
            ^!Set %numberlength%="^$Calc(^$StrSize("^$Calc(^%end%-^%start%)$")$)$"
            ^!Jump Select_Start
            ^!Jump Line_Start

            ^!Set %counter%="0"



            :NumberLines
            ^!Inc %counter%

            :PlaceNumber
            ;next line is long
            ^!InsertText
            "^$StrFill("0";^$Calc(^%numberlength%-^$StrSize("^%counter%")$)$)$^%counter%.
            "
            ^!If "^$GetRow$" = "^%end%" END
            ^!Jump +1
            ^!Goto NumberLines
            ;line 35 if we did this right including blank lines
          • Don - HtmlFixIt.com
            ;whacked at by don at htmlfixit.com ^!SetWordWrap Off ;Clear all Variables ^!ClearVariables ^!Set %numberlength%= ^$Calc(^$StrSize( ^$GetLineCount$ )$)$
            Message 5 of 27 , Dec 28, 2007
            • 0 Attachment
              ;whacked at by don at htmlfixit.com
              ^!SetWordWrap Off
              ;Clear all Variables
              ^!ClearVariables

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



              ^!Jump TEXT_START

              ^!Set %counter%="0"

              :NumberLines
              ^!Inc %counter%

              :PlaceNumber
              ^!InsertText
              "^$StrFill("0";^$Calc(^%numberlength%-^$StrSize("^%counter%")$)$)$^%counter%.
              "
              ^!If "^$GetRow$" = "^$GetLineCount$" END
              ^!Jump +1
              ^!Goto NumberLines
              ;line 22 if we did this right
            • Don - HtmlFixIt.com
              first is just highlighted and second is all lines this could easily be improved by: 1. resetting wordwrap to on/off so it is as it was 2. allowing you to
              Message 6 of 27 , Dec 28, 2007
              • 0 Attachment
                first is just highlighted and second is all lines

                this could easily be improved by:
                1. resetting wordwrap to on/off so it is as it was
                2. allowing you to decide if you want leading zero's on numbers (I
                almost always do)
                3. allowing you to set the "delimiter after the number (I used period +
                space)

                If you want a remove line number, I would probably use a regex as suggested.

                Don
              • Axel Berger
                ... Nicely done, as always. I like your solution and I see that my preparatory first step was totally superfluous. Axel
                Message 7 of 27 , Dec 28, 2007
                • 0 Attachment
                  "Don - HtmlFixIt.com" wrote:
                  > ;line 35 if we did this right including blank lines

                  Nicely done, as always. I like your solution and I see that my
                  preparatory first step was totally superfluous.

                  Axel
                • Flo
                  ... Don, Thanks for that Clip -- it s working fine! With 15,000 lines, it takes 3:04 minutes on my notebook. When adding... ^!SetScreenUpdate Off it runs 1:26
                  Message 8 of 27 , Dec 28, 2007
                  • 0 Attachment
                    --- In ntb-clips@yahoogroups.com, "Don - HtmlFixIt.com" <don@...>
                    wrote:
                    >
                    > ;whacked at by don at htmlfixit.com
                    > ^!SetWordWrap Off
                    > ;Clear all Variables
                    > ^!ClearVariables
                    >
                    > ^!Set %numberlength%="^$Calc(^$StrSize("^$GetLineCount$")$)$"
                    >
                    > ^!Jump TEXT_START....

                    Don,

                    Thanks for that Clip -- it's working fine!

                    With 15,000 lines, it takes 3:04 minutes on my notebook. When
                    adding...

                    ^!SetScreenUpdate Off

                    it runs 1:26 minutes.

                    You may like to test the following Clip. It numbers those 15,000
                    lines within a second, replacing leading spaces with "0" as well...


                    ^!Select All
                    ^!Menu Modify/Lines/Number Lines
                    ^!Replace "(^|(?<=\x20))\x20" >> "0" AWRS


                    The RegEx works with a Positive Lookbehind Assertion. It says:
                    Replace any space (Hex \x20) with 0 that is matched at the beginning
                    of a line or that is preceded by a space. Thus we avoid replacing the
                    space that follows the line number. -- I hope that RegEx survives
                    Sheri's critical eye ;-)

                    Regards,
                    Flo
                  • Dave
                    Hi works well ,anyway of stopping it going to the end of the page if you only do the top half. ? THANKYOU DAVE M ... From: Flo To:
                    Message 9 of 27 , Dec 28, 2007
                    • 0 Attachment
                      Hi
                      works well ,anyway of stopping it going to the end of the page if you only
                      do the top half. ?
                      THANKYOU DAVE M

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


                      > --- In ntb-clips@yahoogroups.com, "Don - HtmlFixIt.com" <don@...>
                      > wrote:
                      >>
                      >> ;whacked at by don at htmlfixit.com
                      >> ^!SetWordWrap Off
                      >> ;Clear all Variables
                      >> ^!ClearVariables
                      >>
                      >> ^!Set %numberlength%="^$Calc(^$StrSize("^$GetLineCount$")$)$"
                      >>
                      >> ^!Jump TEXT_START....
                      >
                      > Don,
                      >
                      > Thanks for that Clip -- it's working fine!
                      >
                      > With 15,000 lines, it takes 3:04 minutes on my notebook. When
                      > adding...
                      >
                      > ^!SetScreenUpdate Off
                      >
                      > it runs 1:26 minutes.
                      >
                      > You may like to test the following Clip. It numbers those 15,000
                      > lines within a second, replacing leading spaces with "0" as well...
                      >
                      >
                      > ^!Select All
                      > ^!Menu Modify/Lines/Number Lines
                      > ^!Replace "(^|(?<=\x20))\x20" >> "0" AWRS
                      >
                      >
                      > The RegEx works with a Positive Lookbehind Assertion. It says:
                      > Replace any space (Hex \x20) with 0 that is matched at the beginning
                      > of a line or that is preceded by a space. Thus we avoid replacing the
                      > space that follows the line number. -- I hope that RegEx survives
                      > Sheri's critical eye ;-)
                      >
                      > Regards,
                      > Flo
                      >
                      >
                      >
                      >
                      >
                      > Fookes Software: http://www.fookes.com/
                      > Fookes Software Discussion Lists: http://www.fookes.com/groups.php
                      > Yahoo! Groups Links
                      >
                      >
                      >
                      >
                    • Don - HtmlFixIt.com
                      ... Never realized that there was a menu command for numbering lines! This program never ceases to surprise me. It is fast. I don t like that if I want to
                      Message 10 of 27 , Dec 28, 2007
                      • 0 Attachment
                        Flo wrote:
                        > Don,
                        >
                        > Thanks for that Clip -- it's working fine!
                        >

                        > You may like to test the following Clip. It numbers those 15,000
                        > lines within a second, replacing leading spaces with "0" as well...
                        >
                        >
                        > ^!Select All
                        > ^!Menu Modify/Lines/Number Lines
                        > ^!Replace "(^|(?<=\x20))\x20" >> "0" AWRS

                        Never realized that there was a menu command for numbering lines! This
                        program never ceases to surprise me. It is fast.

                        I don't like that if I want to change the "delimiter" I need to use the
                        modify command. I tried finding a manual place to do it with no luck.
                        I also don't like the dialog that asks how to number it. For the size
                        files I use I think I'll stick with mine. I typically don't use
                        screenupdateoff as I like to watch the program hum :-) I suppose we
                        could turn it off/on based on the length of the file or selection being
                        acted upon too if we wanted to get fancy. You might also come up with a
                        regex to replace my padding method? That might speed things along?

                        Flo, you and Sheri teach me so much!

                        Don
                      • WV-Mike
                        ... I have various lists through out a document which need individually numbered. The clips in the NoteBlocl seems to always number the whole doc. -Mike
                        Message 11 of 27 , Dec 29, 2007
                        • 0 Attachment
                          At 10:53 AM 12/28/2007 , Don - HtmlFixIt.com wrote:

                          >WV-Mike wrote:
                          > > Howdy,
                          > > Anyone out there have a clip which will sequentially number a the rows of
                          > > hi-lighted text?
                          > > I tried the ones in the NoteBlock library - "Numer lines..." , "Insert in
                          > > Front of Block with Incrementing Number..."
                          > >
                          > > However, I could not get them to perform as I wanted:
                          > >
                          > > I hi-light a block, run the clip and then each line is numbered:
                          > >
                          > > 1. text
                          > > 2. text
                          >
                          >So you start at one, not the line number in the document?

                          I have various lists through out a document which need individually numbered.
                          The clips in the NoteBlocl seems to always number the whole doc.

                          -Mike

                          [Non-text portions of this message have been removed]
                        • WV-Mike
                          ... Howdy, I was able to run the clip for all lines but I get an error for the highlighted only. I am sure it is the way I made the long lines but I cannot see
                          Message 12 of 27 , Dec 29, 2007
                          • 0 Attachment
                            At 11:40 AM 12/28/2007 , you wrote:
                            >first is just highlighted and second is all lines
                            >
                            >this could easily be improved by:
                            >1. resetting wordwrap to on/off so it is as it was
                            >2. allowing you to decide if you want leading zero's on numbers (I
                            >almost always do)
                            >3. allowing you to set the "delimiter after the number (I used period +
                            >space)
                            >
                            >If you want a remove line number, I would probably use a regex as suggested.

                            Howdy,
                            I was able to run the clip for all lines but I get an error for the
                            highlighted only.
                            I am sure it is the way I made the long lines but I cannot see where the
                            problem is.

                            Here is the paste from email and then the actual clip I am running:

                            http://epicroadtrips.com/clip/

                            Thanks Don and all!

                            -Mike


                            [Non-text portions of this message have been removed]
                          • Axel Berger
                            ... 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
                            Message 13 of 27 , Dec 29, 2007
                            • 0 Attachment
                              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
                            • Flo
                              ... Don, ... It s in View | Options | General | Number Separator. ... See the new version below. If it always starts with line #1 we could override the prompt
                              Message 14 of 27 , Dec 29, 2007
                              • 0 Attachment
                                --- In ntb-clips@yahoogroups.com, "Don - HtmlFixIt.com" <don@...>
                                wrote:
                                >
                                > Never realized that there was a menu command for numbering
                                > lines! This program never ceases to surprise me...

                                Don,

                                > I don't like that if I want to change the "delimiter" I need
                                > to use the modify command. I tried finding a manual place to do
                                > it with no luck.

                                It's in View | Options | General | Number Separator.

                                > I also don't like the dialog that asks how to number it.

                                See the new version below. If it always starts with line #1 we could
                                override the prompt with a ^!Keyboard Command instead of the full ^!
                                Menu Command.

                                > For the size files I use I think I'll stick with mine.

                                Yes, of course, it's perfectly doing the job up to some hundreds of
                                lines...

                                > I typically don't use screenupdateoff as I like to watch the
                                program hum :-)

                                So do I -- it's like sitting in front of a washing machine ;-)

                                > You might also come up with a regex to replace my padding method?
                                > That might speed things along?

                                I don't see a way for that because your method is based on a string
                                function (^$StrFill) that cannot be combined with a RegEx. I think
                                all kinds of string functions, loops, counters, cursor movements etc
                                tend to slow down the clip performance.

                                Regards,
                                Flo

                                New version of my clip. The first line prevents double spaces inside
                                the lines from being replaced with zero. For
                                example: "American··Express" could be replaced
                                with "American·0Express".

                                ^!Menu Modify/Spaces/Single Space
                                ^!KeyboardDelay 50
                                ^!Keyboard CTRL+A ALT+M L N #1# ENTER
                                ^!Replace "(^|(?<=\x20))\x20" >> "0" AWRS
                              • Flo
                                ... you only ... 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
                                Message 15 of 27 , Dec 29, 2007
                                • 0 Attachment
                                  --- 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
                                • Sheri
                                  ... Hi Flo, Getting rid of extra spaces first removes the issue I saw with it (replacing unrelated spaces with zeros). But maybe it would be better to replace
                                  Message 16 of 27 , Dec 29, 2007
                                  • 0 Attachment
                                    --- In ntb-clips@yahoogroups.com, "Flo" <flo.gehrke@...> wrote:
                                    >
                                    >
                                    > ^!Select All
                                    > ^!Menu Modify/Lines/Number Lines
                                    > ^!Replace "(^|(?<=\x20))\x20" >> "0" AWRS
                                    >
                                    >
                                    > The RegEx works with a Positive Lookbehind Assertion. It says:
                                    > Replace any space (Hex \x20) with 0 that is matched at the beginning
                                    > of a line or that is preceded by a space. Thus we avoid replacing the
                                    > space that follows the line number. -- I hope that RegEx survives
                                    > Sheri's critical eye ;-)
                                    >
                                    > Regards,
                                    > Flo
                                    >

                                    Hi Flo,

                                    Getting rid of extra spaces first removes the issue I saw with it
                                    (replacing unrelated spaces with zeros). But 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.

                                    PS, check your email.

                                    Regards,
                                    Sheri
                                  • 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 17 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 18 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 19 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 20 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 21 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 22 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 23 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 24 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 25 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 26 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 27 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.