Thanks John,
I'm not trying to be "cheeky" but I am frustrated.  Sorry Alex.

John, what you propose may work - haven't tried it yet.
However, that still does not explain why WITHOUT the 0 in front of it, 9:14 was listed before 11:35 in my ascending sort. And just FYI, those are minutes and seconds I'm using and not hours and minutes.

My point is that it seems to me that the dateTime sort does not work properly. What you proposed is a workaround because dateTime does NOT work properly, right?

----- Original Message ----- From: "John Dixon" <[email protected]>
To: "How to use LiveCode" <[email protected]>
Sent: Wednesday, April 02, 2014 2:15 AM
Subject: RE: extremely weird and frustrating...


Another way to do this would be to put a 0 in front of the 'hours & minutes' before you sort them...
Alex, it trying to help you... no need to be cheeky !...

on mouseUp
  set itemdel to ":"
  repeat with count = 1 to the number of lines of fld 1
     if the number of chars of item 1 of line count of fld 1 = 1 then
        put 0 & line count of fld 1 into line count of fld 1
     end if
  end repeat
  sort lines of fld 1
end mouseUp

would give :

01:22
02:08
07:47
09:14
11:35
12:16
15:56
16:33
25:34
34:55

From: [email protected]

Sorry Alex, I do not understand.

16:33 is sixteen minutes and 33 seconds.
So why is 25:34 not twenty-five minutes and 34 seconds?
Last time I checked, there are 60 minutes in an hour.

> 25:34 and 34:55 are not valid dateTimes, so where those lines get > sorted
> to is not well undefined; it looks as though LC simply decides to give
> them a '0:00'.
>
> Apart from those two lines, it looks (to me) like the result is > correct.
> Isn't it ?
>
> -- Alex.
>
>
> On 02/04/2014 08:41, [email protected] wrote:
>> Here is my script line:
>> sort field myTimes descending dateTime

>> 16:33
>> 15:56
>> 12:16
>> 11:35
>> 9:14
>> 7:47
>> 2:08
>> 1:22
>> 25:34
>> 34:55
>>

>> Here is my other script line:

>> 25:34
>> 34:55
>> 1:22
>> 2:08
>> 7:47
>> 9:14
>> 11:35
>> 12:16
>> 15:56
>> 16:33
>>
>> Seriously?


_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to