extremely weird and frustrating...
John Dixon
dixonja at hotmail.co.uk
Wed Apr 2 04:15:31 EDT 2014
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: larry at significantplanet.org
> 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, larry at significantplanet.org 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?
More information about the use-livecode
mailing list