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

Was [NTB] Sorting inline numbers

Expand Messages
  • Stephen
    Hi Amitava and Adrian, Oh Fine, I just noticed this is on the general list and not the clip list. I ll send this to you folks private eMail and also to the
    Message 1 of 1 , May 1, 2001
    View Source
    • 0 Attachment
      Hi Amitava and Adrian,

      Oh Fine, I just noticed this is on the general list and not the clip
      list. I'll send this to you folks private eMail and also to the clip
      list

      I got home today, and created a clip which sorts numbers well.
      I'm not sure it is the most efficient way to do it but it makes numbers
      come out just like we expect them to and as long as the list is less
      than about a hundred is pretty fast.
      I have not tested it with alphanumeric values, but expect it to not like
      them.
      Good luck,
      Stephen

      H="Sort Comma_Space_Delimited_List"
      ^!SetListDelimiter ", "
      ^!SetArray %alpha%=^$GetSelection$
      ^!SetArray %beta%=^%alpha1%
      ^!Set %i%=2
      :iniloop
      ^!If ^%i%>^%alpha0% writeit
      ^!Set %q%=1
      :inqloop
      ^!If ^%alpha^%i%%>^%beta^%q%% notyet ELSE NEXT
      ^!Set %beta^%q%%=^%alpha^%i%%, ^%beta^%q%%
      ^!Set %beta%=^%beta%
      ^!SetArray %beta%=^%beta%
      ^!Inc %i%
      ^!GoTo iniloop
      :notyet
      ^!Inc %q%
      ^!If ^%q%>^%beta0% NEXT ELSE inqloop
      ^!Set %beta^%beta0%%=^%beta^%beta0%%, ^%alpha^%i%%
      ^!Set %beta%=^%beta%
      ^!SetArray %beta%=^%beta%
      ^!Inc %i%
      ^!GoTo iniloop
      :writeit
      ^%beta%

      Adrian/ Rosemary Worsfold wrote:
      >
      > Don't think I'm on the clips list so just replying. This does work, but
      > again not for numbers. The clip that should precede it would find the
      > longest number before a comma, count it and add zeros in front of all
      > others to so that all numbers were the same number of digits. Beyond me.
      >
      > H="Sort comma delimited list"
      > ^!Keyboard CTRL+A
      > ^!Replace " " >> "" [HAS]
      > ^!Replace "," >> "^P" [HAS]
      > ^!Keyboard SHIFT+CTRL+J
      > ^!Keyboard ALT+M L S A
      > ^!Keyboard CTRL+END
      >
      > Add from clipboard.
      >
      > Adrian Worsfold
      >
      > http://www.pluralist.co.uk
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.