Sort of a problem

Peter Haworth pete at lcsql.com
Sun May 13 14:32:34 EDT 2012


Since you mentioend the word "database", Here's another solution that would
work with SQLite (Addresses is the table name and AdrLine is the column
containing the street address):

SELECT * FROM Addresses ORDER BY CASE WHEN substr(AdrLine,1,2) IN ('N ','S
','E ','W ') THEN substr(AdrLine,3) ELSE AdrLine END;


Pete
lcSQL Software <http://www.lcsql.com>



On Sat, May 12, 2012 at 8:17 PM, Jim Hurley <jhurley0305 at sbcglobal.net>wrote:

> Thanks Peter. But I live in a very conservative county. None of yer fancy
> diagonals here. NW indeed!
>
> Actually it is the County election database, and a search reveals only N,
> E, S, and W.
>
> I think I finally get the phrase "by .... of each". Live Code does pretty
> much what I did, 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" <pmbrig at gmail.com>
> > To: How to use LiveCode <use-livecode at lists.runrev.com>
> > Subject: Re: Sort of a problem
> > Message-ID: <50A823D6-005E-47DE-9A05-4B7BA094E693 at gmail.com>
> > Content-Type: text/plain; charset=us-ascii
> >
> > If you have streets like "SW 34th St" you'll have a problem -- you
> should probably adjust your pickStreet function:
> >
> > function pickStreet pName
> >   if word 1 of pName is among the words of "N S E W NE NW SE SW" then
> >      return word 2 to -1 of pName
> >   end if
> >   return pName
> > end pickStreet
> >
> > -- Peter
> >
> > Peter M. Brigham
> > pmbrig at gmail.com
> > http://home.comcast.net/~pmbrig
>
>
> _______________________________________________
> 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