Re: extremely weird and frustrating...
Larry, that should be sort lines of field myTimes descending dateTime I assume that myTimes is a variable, but if it isn't, then your lines should be sort lines of field myTimes descending dateTime -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Installer Maker for LiveCode: http://qery.us/468 Buy my new book Programming LiveCode for the Real Beginner http://qery.us/3fi LiveCode on Facebook: https://www.facebook.com/groups/runrev/ On 4/2/2014 09:41, la...@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
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, la...@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: extremely weird and frustrating...
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 a...@tweedly.net To: use-livecode@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, la...@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@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
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: la...@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, la...@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? ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: extremely weird and frustrating...
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 dixo...@hotmail.co.uk To: How to use LiveCode use-livecode@lists.runrev.com 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: la...@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, la...@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? ___ use-livecode mailing list use-livecode@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: extremely weird and frustrating...
John, There's no need to use a repeat loop: on mouseUp put fld 1 into myList set the itemDel to colon sort lines of myList numeric by item 2 of each sort lines of myList numeric by item 1 of each put myList into fld 2 end mouseUp -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Installer Maker for LiveCode: http://qery.us/468 Buy my new book Programming LiveCode for the Real Beginner http://qery.us/3fi LiveCode on Facebook: https://www.facebook.com/groups/runrev/ On 4/2/2014 10:25, la...@significantplanet.org wrote: 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 dixo...@hotmail.co.uk To: How to use LiveCode use-livecode@lists.runrev.com Sent: Wednesday, April 02, 2014 2:15 AM Subject: RE: extremely weird and frustrating... ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: extremely weird and frustrating...
Larry, I looked at this again. If I use the following script on mouseUp set the twelveHourTime to true put fld 1 into myList set the itemDel to colon sort lines of myList descending numeric dateTime put myList into fld 2 end mouseUp I get this result: 16:33 15:56 12:16 11:35 9:14 7:47 2:08 1:22 25:34 34:55 which indicates that invalid times are simply not sorted. There are only 24 hours in a day and 24 and higher are invalid numbers for hours. -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Installer Maker for LiveCode: http://qery.us/468 Buy my new book Programming LiveCode for the Real Beginner http://qery.us/3fi LiveCode on Facebook: https://www.facebook.com/groups/runrev/ On 4/2/2014 09:41, la...@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: extremely weird and frustrating...
Well Mark, I guess I do not know how to state minutes and seconds in the proper syntax for a correct dateTime sort. However, your piece of code below works perfectly. Thanks very much! Larry on mouseUp put fld 1 into myList set the itemDel to colon sort lines of myList numeric by item 2 of each sort lines of myList numeric by item 1 of each put myList into fld 2 end mouseUp ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: extremely weird and frustrating...
I think the point is that (since the new guessProgrammerIntent feature that Devin spotted yesterday is no longer available today) the code for interpreting as dateTime has to make assumptions when the data isn't explicit. Not unreasonably, asked to interpret dd:dd as a datetime value, the code guesses that it is HH:MM rather than guessing that it is MM:SS. Whereas asked to interpret dd:dd:dd it will definitely interpret that as HH:MM:SS. So I wouldn't agree that What you proposed is a workaround because dateTime does NOT work properly, right? At worst you could say that the implementer, forced to make a decision about how to interpret an ambiguous input, made the wrong call (interpret it as HH:MM rather than as MM:SS) - but I think it's a judgement call, neither would really be wrong or right, just which is likely to be most useful in most cases. (Of course it's also worth noting that the way sort works is to apply the sorting function to pairs of input. The dateTime evaluation is applied to each piece of data in turn - there's no overall evaluation. An intelligent human operator, asked to sort a dozen items, might start interpreting them as HH:MM, then come across an instance which couldn't validly be interpreted as HH:MM but could be as MM:SS, and therefore decide to start over, now treating everything as MM:SS. But what we have is a machine, implementing a relatively efficient and flexible mechanism - which rightly precludes behaviour like that.) Ben On 02/04/2014 09:25, la...@significantplanet.org wrote: 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 dixo...@hotmail.co.uk To: How to use LiveCode use-livecode@lists.runrev.com 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: la...@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, la...@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? ___ use-livecode mailing list use-livecode@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: extremely weird and frustrating...
Thank you Ben. I agree with what you say and just hadn't thought of that - because my mind was locked in on MM:SS. So Mark gave me a piece of code that works perfectly in sorting the field how I want. And now I recognize that Mark's code is NOT a workaround, but just taking into account what you just said. So the good news is: I'm no longer frustrated. I guess the bad news is: I'm still weird! Thanks for the lesson! Larry - Original Message - From: Ben Rubinstein benr...@cogapp.com To: How to use LiveCode use-livecode@lists.runrev.com Sent: Wednesday, April 02, 2014 3:17 AM Subject: Re: extremely weird and frustrating... I think the point is that (since the new guessProgrammerIntent feature that Devin spotted yesterday is no longer available today) the code for interpreting as dateTime has to make assumptions when the data isn't explicit. Not unreasonably, asked to interpret dd:dd as a datetime value, the code guesses that it is HH:MM rather than guessing that it is MM:SS. Whereas asked to interpret dd:dd:dd it will definitely interpret that as HH:MM:SS. So I wouldn't agree that What you proposed is a workaround because dateTime does NOT work properly, right? At worst you could say that the implementer, forced to make a decision about how to interpret an ambiguous input, made the wrong call (interpret it as HH:MM rather than as MM:SS) - but I think it's a judgement call, neither would really be wrong or right, just which is likely to be most useful in most cases. (Of course it's also worth noting that the way sort works is to apply the sorting function to pairs of input. The dateTime evaluation is applied to each piece of data in turn - there's no overall evaluation. An intelligent human operator, asked to sort a dozen items, might start interpreting them as HH:MM, then come across an instance which couldn't validly be interpreted as HH:MM but could be as MM:SS, and therefore decide to start over, now treating everything as MM:SS. But what we have is a machine, implementing a relatively efficient and flexible mechanism - which rightly precludes behaviour like that.) Ben On 02/04/2014 09:25, la...@significantplanet.org wrote: 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 dixo...@hotmail.co.uk To: How to use LiveCode use-livecode@lists.runrev.com 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: la...@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, la...@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? ___ use-livecode mailing list use-livecode@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo
Re: extremely weird and frustrating...
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, la...@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 a...@tweedly.net To: use-livecode@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, la...@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@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@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: extremely weird and frustrating...
(answering my own responses again :-) It depends what your file contains if the time is more than one hour. If the time was, say, sixty-five-and-a-half minutes, would the file entry be 65:30 or 1:05:30 If it's the former, then Mark's two-step sort is the right answer. If it's the latter, then my custom function sort given earlier will work. If it could be either - then you'd need to extend the custom function; this will work for either 65:30 or 1:05:30 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 put item 1 of pTime into tMins put tMins div 60 into tHours put tMins mod 60 into tMins return tHours : tMins : item 2 of pTime end if return pTime -- already is hours:mins:secs end hoursMinsSecs And if minutes can be negative, then that's left as an exercise :-) -- Alex. On 02/04/2014 12:04, Alex Tweedly wrote: 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, la...@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 a...@tweedly.net To: use-livecode@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, la...@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@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@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@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: extremely weird and frustrating... - Domain does not exist
I think if you set the numberFormat to “00” and itemDelimiter to “:” you can add 0 to each item. Bob On Apr 2, 2014, at 01:15 , John Dixon dixo...@hotmail.co.uk wrote: 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: la...@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, la...@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? ___ use-livecode mailing list use-livecode@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: extremely weird and frustrating...
I think he is saying that 9:14 and 11:35 is not a valid dateTime so the engine reverts to a text sort. There is no date in the dateTime. Bob On Apr 2, 2014, at 01:25 , la...@significantplanet.org la...@significantplanet.org wrote: 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 dixo...@hotmail.co.uk To: How to use LiveCode use-livecode@lists.runrev.com 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: la...@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, la...@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? ___ use-livecode mailing list use-livecode@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@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@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode