Re: sort by length of line (Weird)

2011-12-13 Thread Bob Sneidar
eerm... yes we can. Bob On Dec 13, 2011, at 2:20 PM, Mark Wieder wrote: > in the same > way that we can't just say "add 1 to x" ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage yo

Re: sort by length of line (Weird)

2011-12-13 Thread Mark Wieder
Richard- Tuesday, December 13, 2011, 1:48:56 PM, you wrote: > There are others, and they wind up consuming a fair amount of time when > I'm teaching someone LiveCode for the first time. > Exceptions require memorization, and with a language this broad it can > helpful to keep the rule set as sma

Re: sort by length of line (Weird)

2011-12-13 Thread Richard Gaskin
Mark Wieder wrote: Richard- Good points all. I'm not requesting that the sort command be smart enough to handle all situations, but this is enough of a confusing point that I think the engine could benefit from some extra smarts. A simple parsing optimization for cases like sort tVar by length

Re: sort by length of line (Weird)

2011-12-13 Thread Mark Wieder
Richard- Good points all. I'm not requesting that the sort command be smart enough to handle all situations, but this is enough of a confusing point that I think the engine could benefit from some extra smarts. A simple parsing optimization for cases like sort tVar by length(each) could insert t

Re: sort by length of line (Weird)

2011-12-13 Thread Mark Wieder
stephen- Tuesday, December 13, 2011, 11:32:30 AM, you wrote: > A downside with plain english style programming code methods is that this > can lead to uncontrolled bouts of alliteration, pun-making and double > entendre. Basic and COBOL people don't talk that way. CONTINUE. -- -Mark Wieder mw

Re: sort by length of line (Weird)

2011-12-13 Thread Mark Wieder
Pete- Tuesday, December 13, 2011, 10:05:05 AM, you wrote: > I think Mark's point is specifically to do with the length function which > can only return a numeric value. The suggestion is that the sort command > should be smart enough to know that and automatically use a numeric sort > (unless ov

Re: sort by length of line (Weird)

2011-12-13 Thread stephen barncard
A downside with plain english style programming code methods is that this can lead to uncontrolled bouts of alliteration, pun-making and double entendre. Basic and COBOL people don't talk that way. On 13 December 2011 10:45, Pete wrote: > Nice! I wish that had been a conscious play on words. >

Re: sort by length of line (Weird)

2011-12-13 Thread Mark Wieder
Colin- Tuesday, December 13, 2011, 10:04:50 AM, you wrote: > How did you sort those lines, before reading between them? Note to self: file enhancement request for sort between the lines of -- -Mark Wieder mwie...@ahsoftware.net ___ use-livecode

Re: sort by length of line (Weird)

2011-12-13 Thread Pete
Nice! I wish that had been a conscious play on words. On Tue, Dec 13, 2011 at 10:04 AM, Colin Holgate wrote: > How did you sort those lines, before reading between them? > > > On Dec 13, 2011, at 12:29 PM, Pete wrote: > > > Looks like your bug report got changed to an enhancement request with n

Re: sort by length of line (Weird)

2011-12-13 Thread Bob Sneidar
You have to read between them to know how not to sort. Bob On Dec 13, 2011, at 10:04 AM, Colin Holgate wrote: > How did you sort those lines, before reading between them? > > > On Dec 13, 2011, at 12:29 PM, Pete wrote: > >> Looks like your bug report got changed to an enhancement request wit

Re: sort by length of line (Weird)

2011-12-13 Thread Pete
I think Mark's point is specifically to do with the length function which can only return a numeric value. The suggestion is that the sort command should be smart enough to know that and automatically use a numeric sort (unless overridden) since it's not possible for text data to be produced. I a

Re: sort by length of line (Weird)

2011-12-13 Thread Colin Holgate
How did you sort those lines, before reading between them? On Dec 13, 2011, at 12:29 PM, Pete wrote: > Looks like your bug report got changed to an enhancement request with not > much chance of happening (reading between the lines). ___ use-livecode m

Re: sort by length of line (Weird)

2011-12-13 Thread Richard Gaskin
Mark Wieder wrote: I'm sort of OK with it because there's a simple way to get the desired answer. But I filed bug 9910 requesting the simplified syntax with "numeric" being optional. Respectfully, I think it may be asking a bit much of the engine - and perhaps the scripter - to expect the eng

Re: sort by length of line (Weird)

2011-12-13 Thread Pete
Hi Mark, Looks like your bug report got changed to an enhancement request with not much chance of happening (reading between the lines). On Mon, Dec 12, 2011 at 6:10 PM, Mark Wieder wrote: > Craig- > > Monday, December 12, 2011, 5:18:26 PM, you wrote: > > > I'm OK with it. > > I'm sort of OK wit

Re: sort by length of line (Weird)

2011-12-13 Thread Bob Sneidar
I went to bed thinking about this. Think about what would have to happen for Livecode to conclude this needed to be a numeric sort: It would have to evaluate every line in the sort, and if it found just one line that was not a number, it would have to then use a text sort. What if the list was 1

Sort by length of line (Rant)

2011-12-12 Thread dunbarx
? I can't really think of a "natural" way, can you? Craig -Original Message- From: Mark Wieder To: How to use LiveCode Sent: Mon, Dec 12, 2011 4:12 pm Subject: Re: sort by length of line (Weird) Craig- Monday, December 12, 2011, 5:18:26 PM, you wrote: > I'm

Re: sort by length of line (Weird)

2011-12-12 Thread Mark Wieder
Craig- Monday, December 12, 2011, 5:18:26 PM, you wrote: > I'm OK with it. I'm sort of OK with it because there's a simple way to get the desired answer. But I filed bug 9910 requesting the simplified syntax with "numeric" being optional. -- -Mark Wieder mwie...@ahsoftware.net _

Re: sort by length of line (Weird)

2011-12-12 Thread Mark Wieder
Bob- Monday, December 12, 2011, 3:56:31 PM, you wrote: > It is doing just that, only it's doing a text sort of the numbers: > 1 > 10 > 100 > 11 > 12 > etc. Yes, and that's just wrong. I can think of no problem for which that is the solution. -- -Mark Wieder mwie...@ahsoftware.net __

Re: sort by length of line (Weird)

2011-12-12 Thread dunbarx
Original Message- From: Bob Sneidar To: How to use LiveCode Sent: Mon, Dec 12, 2011 1:58 pm Subject: Re: sort by length of line (Weird) It is doing just that, only it's doing a text sort of the numbers: 1 10 100 11 12 etc. He wants a NUMERIC sort of the numbers. Hence sort myVar

Re: sort by length of line (Weird)

2011-12-12 Thread Bob Sneidar
It is doing just that, only it's doing a text sort of the numbers: 1 10 100 11 12 etc. He wants a NUMERIC sort of the numbers. Hence sort myVar numeric by the length of each Bob On Dec 12, 2011, at 11:56 AM, Mark Wieder wrote: > OK - that's just weird. I see what's going on, but what I'd expect

Re: sort by length of line (Weird)

2011-12-12 Thread Ken Ray
On Dec 12, 2011, at 1:56 PM, Mark Wieder wrote: > OK - that's just weird. I see what's going on, but what I'd expect is what (I > think) Craig expects - that I'd get a list of the strings sorted by their > character lengths. > > Is there *any* use case in which you'd want strings sorted by the a

Re: sort by length of line (Weird)

2011-12-12 Thread dunbarx
ec 12, 2011 9:59 am Subject: Re: sort by length of line (Weird) OK - that's just weird. I see what's going on, but what I'd expect is what (I think) Craig expects - that I'd get a list of the strings sorted by their character lengths. Is there *any* use case in which you

Re: sort by length of line (Weird)

2011-12-12 Thread dunbarx
Well, well. I never would have thought it was doing that, though I get it. Thanks all. -Original Message- From: Ken Ray To: How to use LiveCode Sent: Mon, Dec 12, 2011 8:08 am Subject: Re: sort by length of line (Weird) On Dec 12, 2011, at 11:09 AM, Mark Schonewille wrote

Re: sort by length of line (Weird)

2011-12-12 Thread Mark Wieder
OK - that's just weird. I see what's going on, but what I'd expect is what (I think) Craig expects - that I'd get a list of the strings sorted by their character lengths. Is there *any* use case in which you'd want strings sorted by the alphabetic representations of their lengths? I can't think of

Re: sort by length of line (Weird)

2011-12-12 Thread Colin Holgate
I figured it out, and it's a funny little issue! It is doing the sort correctly, but is evaluating the length of the words in an alphabetic way. The 10 letter words are alphabetically shorter than the 9 letter words, because "10" comes before "9". You can solve it like this: sort fld 2 numeric

Re: sort by length of line (Weird)

2011-12-12 Thread stephen barncard
Which is a also a great (and fastest) way to get the max width of text in a column. get fld "B" sort lines of it numeric *descending* by number of characters of each put number of characters in line 1 of it into tWidest_Word_Width don't you just love BINARY?? On 12 December 2011 09:09, Mark S

Re: sort by length of line (Weird)

2011-12-12 Thread Ken Ray
On Dec 12, 2011, at 11:09 AM, Mark Schonewille wrote: > Try numeric. Right - Here's an explanation: when you sort by length, what gets sorted is the actual *numbers* themselves, so unless you tell LC to "sort numeric", you'll get things in this order: 1 10 11 2 3 4 (etc.). With your data, it

Re: sort by length of line (Weird)

2011-12-12 Thread Mark Schonewille
Try numeric. -- Kind regards, Mark Schonewille Economy-x-Talk Http://economy-x-talk.com Share the clipboard of your computer over a local network with Clipboard Link http://clipboardlink.economy-x-talk.com Op 12 dec. 2011 om 17:55 heeft dunb...@aol.com het volgende geschreven: > Hmmm. > >

Re: sort by length of line (Weird)

2011-12-12 Thread dunbarx
-Original Message- From: Mark Schonewille To: How to use LiveCode Sent: Sun, Dec 11, 2011 6:54 pm Subject: Re: sort by length of line Hi Craig, sort lines of myList by length(each) sort lines of myList by the length of each sort lines of myList by number of chars of each "Eac

Re: sort by length of line

2011-12-11 Thread Mark Schonewille
Hi Craig, sort lines of myList by length(each) sort lines of myList by the length of each sort lines of myList by number of chars of each "Each" is simply the element that's currently being sorted, as if you put a repeat loop into one line of syntax. -- Best regards, Mark Schonewille Economy-

Re: sort by length of line

2011-12-11 Thread Devin Asay
On Dec 11, 2011, at 9:04 PM, wrote: > > I can do this the long way, but is there a clever sortkey that will sort > lines by the length of those lines? > > In other words, if I have a variable myVar with: > > aaa > xxx > > > I want to write something like: > > sort myVar by the len

sort by length of line

2011-12-11 Thread dunbarx
Sorry, should have made a new thread. I can do this the long way, but is there a clever sortkey that will sort lines by the length of those lines? In other words, if I have a variable myVar with: aaa xxx I want to write something like: sort myVar by the length of each to