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

Re: [Clip] Re: sorting an array

Expand Messages
  • Don - HtmlFixIt.com
    Your assistance was of much help Sheri and Alec! and the magic line that in fact sorts from a semi-colon delimited (that is the default) array back into the
    Message 1 of 25 , Jul 1, 2009
    • 0 Attachment
      Your assistance was of much help Sheri and Alec!

      and the magic line that in fact sorts from a semi-colon delimited (that
      is the default) array back into the same semi-colon delimited array ....
      all one line ...

      ^!SetArray
      %fielddynamics%=^$StrReplace("^P";";";"^$StrSort("^$StrReplace(";";"^P";"^%fielddynamics%";0;0)$";No;Yes;No)$";No;No)$

      so I had this in fielddynamics when I started:
      0031:2:33:Place;0005:26:31:Name;0034:22:56:School;0001:3:4:Grade;0056:8:64:Time

      And this when I'm done:
      0001:3:4:Grade;0005:26:31:Name;0031:2:33:Place;0034:22:56:School;0056:8:64:Time

      So it is sorted 1, 5, 31, 34, 56 as it should be.

      Alec Burgess wrote:
      > Don ... our messages crossed each other. You are saying much the same as
      > I did below "-)
      >
      > Don - HtmlFixIt.com (don@...) wrote (in part) (on 2009-07-01
      > at 00:30):
      > ^!SetClipboard=^$StrSort("^$StrReplace(";";"^P";"12;03;15;99;24;05;54;50";0;0)$";No;Yes;No)$
      >> ^!SetArray
      > ew%=^$StrReplace("^P";";";"^$GetClipboard$";0;0)$
      >> ^!Info [C]^
      > ew%
      >> 03;05;12;15;24;50;54;99
      >>
      >> If I were willing to use ^P as delimiters think I can get it down to
      >> one
      >> line.
      >>
      >> ^!SetArray
      >>
      > ew%=^$StrSort("^$StrReplace(";";"^P";"12;03;15;99;24;05;54;50";0;0)$";No;Yes;No)$
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.