Simple array question

Frank D. Engel, Jr. fde101 at fjrhome.net
Thu Sep 30 19:51:20 EDT 2004


Untested, but this might work:

put the keys of x into y
sort lines of y
put empty into z
repeat with i = 1 to the number of lines in y
   put x[i] & the lineDelimiter after z
end repeat
delete the last char of z
put z into field 2

On Sep 30, 2004, at 6:50 PM, Mark Brownell wrote:

>
> On Thursday, September 30, 2004, at 02:48 PM, Jim Hurley wrote:
>
>>  repeat with i = 1 to m
>>     put x[i] into line i of tResults
>>  end repeat
>>  put tResults into field 2
>>
>>
>> But is there any quick way to get the list sorted by the keys? I have 
>> 11,000 elements in the array.
>>
>> Jim
>
> Maybe by using a faster repeat loop and a simpler append technique.
>
> put "" into tResults
> put 1 into i
> repeat
>     put x[i] & return after tResults
>     if x[i] = empty then exit repeat
>     add 1 to i
>  end repeat
>  put tResults into field 2
>
> This is not sorting, I guess.
>
> Mark
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
-----------------------------------------------------------
Frank D. Engel, Jr.  <fde101 at fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten 
Son, that whosoever believeth in him should not perish, but have 
everlasting life.
$



___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com



More information about the use-livecode mailing list