<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Alphabetize List in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Alphabetize-List/m-p/94365#M31665</link>
    <description>Danke sehr mein Freund. I have been meaning to figure something like this out for some time. I hadn't expected the code to be so short. I look forward to trying it out.</description>
    <pubDate>Sat, 17 Feb 2007 18:45:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-02-17T18:45:02Z</dc:date>
    <item>
      <title>Alphabetize List</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Alphabetize-List/m-p/94362#M31662</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Anybody know a trick for alphabetizing a list in GDL?&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Feb 2007 14:27:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Alphabetize-List/m-p/94362#M31662</guid>
      <dc:creator>James Murray</dc:creator>
      <dc:date>2007-02-14T14:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetize List</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Alphabetize-List/m-p/94363#M31663</link>
      <description>One of the basic programming issues. &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt; Are you looking for an algorithm or a ready to use script? Best should be bubble sort, I guess.&lt;BR /&gt;
Comparing two strings can be done by &amp;lt; or &amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
From brain to keyboard:
&lt;PRE&gt;dim t[], s[]

! ### set source
t[1]="one "
t[2]="two "
t[3]="three "
t[4]="four "

! ### preset destination
FOR i=1 TO VARDIM1(t)
 s&lt;I&gt;=""
 NEXT i

! ### sort
FOR i=1 TO VARDIM1(t)
 p=i
 FOR j=1 TO i-1
  IF s&lt;J&gt;&amp;gt;t&lt;I&gt; THEN
   ! insert element
   FOR k=i TO j+1 STEP -1
    s&lt;K&gt;=s[k-1]
    NEXT k
   p=j : j=VARDIM1(s)
   ENDIF
  NEXT j
 s&lt;P&gt;=t&lt;I&gt;
 NEXT i

! ### output
PRINT s, "/", VARDIM1(s)&lt;/I&gt;&lt;/P&gt;&lt;/K&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Feb 2007 15:13:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Alphabetize-List/m-p/94363#M31663</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2007-02-14T15:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetize List</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Alphabetize-List/m-p/94364#M31664</link>
      <description>Viel Dank, Frank. I'll give it a go.</description>
      <pubDate>Wed, 14 Feb 2007 23:46:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Alphabetize-List/m-p/94364#M31664</guid>
      <dc:creator>James Murray</dc:creator>
      <dc:date>2007-02-14T23:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetize List</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Alphabetize-List/m-p/94365#M31665</link>
      <description>Danke sehr mein Freund. I have been meaning to figure something like this out for some time. I hadn't expected the code to be so short. I look forward to trying it out.</description>
      <pubDate>Sat, 17 Feb 2007 18:45:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Alphabetize-List/m-p/94365#M31665</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-02-17T18:45:02Z</dc:date>
    </item>
  </channel>
</rss>

