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

Re: [Clip] Changing numbers to ordinal

Expand Messages
  • hsavage
    ... The previous clip, H= Add Ordinal Clip , works well to thirty-one but those long can be trouble and without mods is limited to 31. I thought this might be
    Message 1 of 10 , Mar 24, 2006
    • 0 Attachment
      rickah wrote:
      > P.S. I changed "^!Info ^%..." to "^!InsertHTML ^%..." so that it
      > automatically updates the number. I hope this is the correct process.
      > It seeems to work.
      >
      > Yours,
      > Rick

      The previous clip, H="Add Ordinal Clip", works well to thirty-one but
      those long can be trouble and without mods is limited to 31.

      I thought this might be a useful clip and I went another way. This clip
      should add the correct suffix to any number, I've tested combinations to
      over a thousand. This clip allows you to quickly add an ordinal suffix
      to all numbers.

      <>·······Start Clip·······<>
      H="ORDINALS EVERYWHERE"
      ;_ Modified-Updated~Created_20060324
      ;_ hrs ø hsavage·pobox·com_06:05:43p
      ; 1st 2nd 3rd 4th 11th
      ; array of ordinal suffixes
      ^!SetArray %sfx%=st;nd;rd;th
      ^!Set %num%=^$GetSelection$
      ;
      ^!If ^$StrCopyRight("^$GetSelection$";2)$ = 11 ^!InsertText ^%num%^%sfx4%
      ^!If ^$StrCopyRight("^$GetSelection$";2)$ = 12 ^!InsertText ^%num%^%sfx4%
      ^!If ^$StrCopyRight("^$GetSelection$";2)$ = 13 ^!InsertText ^%num%^%sfx4%
      ^!If ^$StrCopyRight("^$GetSelection$";1)$ => 4 ^!InsertText ^%num%^%sfx4%
      ^!If ^$StrCopyRight("^$GetSelection$";1)$ = 0 ^!InsertText ^%num%^%sfx4%
      ^!If ^$StrCopyRight("^$GetSelection$";1)$ = 1 ^!InsertText ^%num%^%sfx1%
      ^!If ^$StrCopyRight("^$GetSelection$";1)$ = 2 ^!InsertText ^%num%^%sfx2%
      ^!If ^$StrCopyRight("^$GetSelection$";1)$ = 3 ^!InsertText ^%num%^%sfx3%
      <>········End Clip········<>

      Each of the longer lines ends with ^!InsertText ^%num%^%sfx(1-4)%

      ºvº
      06.03.24_17.37
      -Newspaper HeadLine...
      "Iraqi Head Seeks Arms"
      hrs ø hsavage@...
    • Don - htmlfixit.com
      typo this line? ^!If ^$StrCopyRight( ^$GetSelection$ ;1)$ = 4 ^!InsertText ^%num%^%sfx4%
      Message 2 of 10 , Mar 24, 2006
      • 0 Attachment
        typo this line?
        ^!If ^$StrCopyRight("^$GetSelection$";1)$ => 4 ^!InsertText ^%num%^%sfx4%
      • hsavage
        ... Don, What about this line indicates a typo, if referencing, greater than, it is there to insure digits 4-9 are handled. I know NoteTab displays it in
        Message 3 of 10 , Mar 24, 2006
        • 0 Attachment
          Don - htmlfixit.com wrote:
          > typo this line?
          > ^!If ^$StrCopyRight("^$GetSelection$";1)$ => 4 ^!InsertText ^%num%^%sfx4%

          Don,

          What about this line indicates a typo, if referencing, greater > than,
          it is there to insure digits 4-9 are handled.

          I know NoteTab displays it in help this way, >= returns True if left
          value is greater or equal to right value, but reversing symbols works also.

          ºvº
          06.03.24_17.57
          -Newspaper HeadLine...
          "Iraqi Head Seeks Arms"
          hrs ø hsavage@...
        • Don - htmlfixit.com
          ... Yep didn t realize it worked either way. Excellent job.
          Message 4 of 10 , Mar 25, 2006
          • 0 Attachment
            hsavage wrote:
            > Don - htmlfixit.com wrote:
            > > typo this line?
            > > ^!If ^$StrCopyRight("^$GetSelection$";1)$ => 4 ^!InsertText ^%num%^%sfx4%
            >
            > Don,
            >
            > What about this line indicates a typo, if referencing, greater > than,
            > it is there to insure digits 4-9 are handled.
            >
            > I know NoteTab displays it in help this way, >= returns True if left
            > value is greater or equal to right value, but reversing symbols works also.

            Yep didn't realize it worked either way. Excellent job.
          • rickah
            Mr. Savage, Yes, it does work just as you say. Thank you very much. I have added it to my library. Yours, Rick ... clip ... combinations to ... suffix ...
            Message 5 of 10 , Mar 25, 2006
            • 0 Attachment
              Mr. Savage,
              Yes, it does work just as you say. Thank you very much. I have
              added it to my library.

              Yours,
              Rick

              --- In ntb-clips@yahoogroups.com, hsavage <hsavage@...> wrote:

              > I thought this might be a useful clip and I went another way. This
              clip
              > should add the correct suffix to any number, I've tested
              combinations to
              > over a thousand. This clip allows you to quickly add an ordinal
              suffix
              > to all numbers.
              >
              > <>·······Start Clip·······<>
              > H="ORDINALS EVERYWHERE"
              <snip>
              > <>········End Clip········<>
              >
              > Each of the longer lines ends with ^!InsertText ^%num%^%sfx(1-4)%
            Your message has been successfully submitted and would be delivered to recipients shortly.