extremely weird and frustrating...

Alex Tweedly alex at tweedly.net
Wed Apr 2 07:04:40 EDT 2014


I think of 16:33 as sixteen hours and 33 minutes - LC won't interpret it 
as minutes and seconds, and thus anything above 23:59 is invalid - and 
therefore apparently interpreted as "0:00"

Unfortunately I can't find a definitive list of valid formats in the 
docs, but nothing in the dictionary entry for 'convert' includes 
mins:secs - it's always either hours:mins or hours:mins:secs, so I'm 
fairly sure that's what's happening.


(You could use a sort by custom function to convert them all to 
hours:min:secs , e.g.

sort field myTimes descending dateTime by hoursMinsSecs(each)

function hoursMinsSecs pTime
   -- change a time in mins:secs to hours:mins:secs
   set the itemDel to ":"
   if  the number of items in pTime = 2 then
      return "0:" & pTime
   end if
    return pTime -- already is hours:mins:secs
  end hoursMinsSecs

-- Alex.


On 02/04/2014 09:02, larry at significantplanet.org wrote:
> 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.
>
> ----- Original Message ----- From: "Alex Tweedly" <alex at tweedly.net>
> To: <use-livecode at lists.runrev.com>
> Sent: Wednesday, April 02, 2014 1:59 AM
> Subject: Re: extremely weird and frustrating...
>
>
>> 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, larry at significantplanet.org wrote:
>>> Here is my script line:
>>> sort field myTimes descending dateTime
>>>
>>>
>>> And here is the result:
>>> 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:
>>>
>>> sort field myTimes ascending dateTime
>>>
>>> And here is the result for that:
>>>
>>> 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
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your 
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode 
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list