Re: Sort of a problem

2012-05-14 Thread Bob Sneidar
Date: Sat, 12 May 2012 12:22:38 -0400 >> From: "Peter M. Brigham, MD" >> To: How to use LiveCode >> Subject: Re: Sort of a problem >> Message-ID: <50a823d6-005e-47de-9a05-4b7ba094e...@gmail.com> >> Content-Type: text/plain; charset=us-ascii &g

Re: Sort of a problem

2012-05-13 Thread Peter Haworth
t; > > > Message: 2 > > Date: Sat, 12 May 2012 12:22:38 -0400 > > From: "Peter M. Brigham, MD" > > To: How to use LiveCode > > Subject: Re: Sort of a problem > > Message-ID: <50a823d6-005e-47de-9a05-4b7ba094e...@gmail.com> > > Content-Type: text

Re: Sort of a problem

2012-05-12 Thread Jim Hurley
except I'm sure they don't use a bubble sort. Jim > > Message: 2 > Date: Sat, 12 May 2012 12:22:38 -0400 > From: "Peter M. Brigham, MD" > To: How to use LiveCode > Subject: Re: Sort of a problem > Message-ID: <50a823d6-005e-47de-9a05-4b7ba094e...@g

Re: Sort of a problem

2012-05-12 Thread Peter M. Brigham, MD
> that I never really caught on to. > > Jim > > >> Date: Thu, 10 May 2012 21:23:36 -0700 >> From: Jerry Jensen >> To: How to use LiveCode >> Subject: Re: Sort of a problem >> >> This seems to do the job. No polish, b

Re: Sort of a problem

2012-05-11 Thread Jerry Jensen
: 5 >> Date: Thu, 10 May 2012 21:23:36 -0700 >> From: Jerry Jensen >> To: How to use LiveCode >> Subject: Re: Sort of a problem >> Message-ID: >> Content-Type: text/plain; charset=us-ascii >> >> This seems to do th

Re: Sort of a problem

2012-05-11 Thread Jim Hurley
Thanks Jerry. That is what I was looking for. There is some magic going on behind the scenes with that "by ... of each" that I never really caught on to. Jim > > Message: 5 > Date: Thu, 10 May 2012 21:23:36 -0700 > From: Jerry Jensen > To: How to use LiveCode

Re: Sort of a problem

2012-05-11 Thread Bob Sneidar
There ya go. :-) Bob On May 10, 2012, at 9:23 PM, Jerry Jensen wrote: > This seems to do the job. No polish, but you'll get the idea. > .Jerry > > Aw, crap, forgot about no attachments. Here's the code: > > > > on mouseUp > local tList > p

Re: Sort of a problem

2012-05-11 Thread Bob Sneidar
Loop through each line putting the actual street name in item 2, sort by item 2 of each, loop through and delete item 2 of every line. Bit clunky, but effective. Another way would be to have a function and sort by the returned value of the function. Not sure that is possible but I think I saw th

Re: Sort of a problem

2012-05-11 Thread Kay C Lan
Because I live in a world of exceptions I thought I'd throw together a function that allowed the easy integration of them: First a new List; Northern Rd Nth South St So Ave Main St South Rd Northwest Ct West East Ave Oak Ave East West Ave N Auburn W Clinton Blvd Kimberly Ct No St Sth Broadway S R

Re: Sort of a problem

2012-05-10 Thread Jerry Jensen
Yeah, but it fails if a street is named "SEW Rd" 8) A better line would be: If word 1 of pName is among the words of "N S E W" then On May 10, 2012, at 9:25 PM, stephen barncard wrote: > that's the one! > > On Thu, May 10, 2012 at 9:23 PM, Jerry Jensen wrote: > >> This seems to do the job. No

Re: Sort of a problem

2012-05-10 Thread stephen barncard
that's the one! On Thu, May 10, 2012 at 9:23 PM, Jerry Jensen wrote: > This seems to do the job. No polish, but you'll get the idea. > .Jerry > > Aw, crap, forgot about no attachments. Here's the code: > > > > on mouseUp > local tList > put fl

Re: Sort of a problem

2012-05-10 Thread Jerry Jensen
This seems to do the job. No polish, but you'll get the idea. .Jerry Aw, crap, forgot about no attachments. Here's the code: on mouseUp local tList put fld "Streets" into tList sort lines of tList by pickStreet(each) put tList into fld

Re: Sort of a problem

2012-05-10 Thread Jerry Jensen
This seems to do the job. No polish, but you'll get the idea. .Jerry On May 10, 2012, at 8:46 PM, Jim Hurley wrote: > I have a list of streets: > > Main St > Oak Ave > N Auburn > Kimberly Ct > S Rector Rd > Maple Ave > W Pine St > Fairmont Ave > > I want to sort them, but ignoring the compass

Re: Sort of a problem

2012-05-10 Thread Terry Judd
How about this... function sortAddresses pAddresses put empty into tOutput repeat for each line tAddress in pAddresses if word 1 of tAddress is in "NSEW" then put tAddress &cr after tOutput else put "~ "&tAddress &cr after tOutput

Re: Sort of a problem

2012-05-10 Thread stephen barncard
the first thing I'd try would be to use 'repeat for each' on both repeat loops and increment the indexes using "add 1 to" On Thu, May 10, 2012 at 8:46 PM, Jim Hurley wrote: > I have a list of streets: > > Main St > Oak Ave > N Auburn > Kimberly Ct > S Rector Rd > Maple Ave > W Pine St > Fairmont

Sort of a problem

2012-05-10 Thread Jim Hurley
I have a list of streets: Main St Oak Ave N Auburn Kimberly Ct S Rector Rd Maple Ave W Pine St Fairmont Ave I want to sort them, but ignoring the compass prefix (N E S W) to give: N Auburn Fairmont Ave Kimberly Ct Main St Maple Ave Oak Ave W Pine St S Rector Rd The best I have come up with is p