Subject Re: [ib-support] Key of varying length problem
Author Paul Schmidt
On 10 Nov 2001, at 10:36, Robert F. Tulloch wrote:

> Hi:
> What do these things really look like and what do they mean?
> In the us, the zip code means something.

They have a very highly defined meaning, each character position
has it's own meaning, I used to know what they were, but that was
years ago, and I don't recall. what they all are, and it varies slightly
depending on where the address is. For example some big office
towers have different postal codes for different groups of floors, an
apartment building will have it's own postal code, a residential
street will have different postal codes for different sides of the

Given that each character has a different meaning, and that they
cover progressively larger areas as you move from right to left, it
makes it more complex. For example K9J 5A2 is a postal code (I
actually lived there my first 20 years or so, the other side of this
one block street was K9J 5A3). Now here is the problem, if each
were a dos file, then K9J is the equivilent of K9J* In other words it
should match any postal code that starts with K9J. I can do this,
however the problem is, that if I have K9J and I have K9 or even K
then K9J 5A2 should match K9J but NOT K9 or K. That is where
the problem is. I don't know how to tell it to look until it finds a
match and then quit.


> > The postal_zone contains a key, that is part of a postal code, it
> > might be X1X 1X1, X1X 1X, X1X 1, X1X, X1 or X
> >
> > say I have the following zones:
> > 1 X1X 1X1
> > 2 X1X 1X
> > 3 X1X 1
> > 4 X1X
> > 5 X1
> > 6 X
> >
> > I have the following postal codes
> >
> > X1X 1X1 must match 1 but not 2,3,4,5 or 6
> > X1X 2E4 must match 4 but not 1,2,3,5 or 6
> > X3F 2Z7 must match 6 but not 1,2,3,4 or 5
> >
> > I am at a loss on how to do this, I can't use another key, because a
> > new zone could be added at any time, and I don't want to have to
> > scan the Postal code file and relink it. I will if I have to, but
> > would rather not.
> >

Paul Schmidt
Tricat Technologies