ZipCode Control

ZipCode is an OCX and Delphi VCL control that is used to obtain the city and state for a specified zip code. The OCX control can be used with programming languages that support OCX controls (i.e., Visual Basic, Delphi (although use of the native VCL is recommended for Delphi), PowerBuilder, Optima++, etc.).

ZipCode is copyrighted and is distributed as a “shareware” product. If you use ZipCode in any computer program (whether it is for your use or for resale), you must first register ZipCode. As long as ZipCode has been registered, you are free to distribute programs that utilize ZipCode without royalty. You should note that one copy of ZipCode must be registered for each developer that uses it.

The registration fee for ZipCode is $10. There is a $5 shipping fee if you need it delivered on a disk instead of via the Internet. ZipCode can be registered with the following form:

Name:___________________________________________________________________________________________

Address:_________________________________________________________________________________________

City:___________________________________ State:_____________________ Zip Code:________________________

Country:__________________________________________________________________________________________

Phone Number:____________________________________________________________________________________

Fax Number:______________________________________________________________________________________

E-Mail Address:____________________________________________________________________________________

Payment Method:

[  ] Check or Money Order    [  ] Visa    [  ] Mastercard

Credit Card Number:________________________________________________________________________________

Expiration Date:____________________________________________________________________________________

Quantity:_______________________  * $10 = ___________________________________________________________

Shipping (Disk Orders Only):                   $ 5 = ____________________________________________________________

Mail To:

TriSoft

366 14th St

Bangor, ME 04401

Voice Orders: 207-945-6889

Fax Orders: 207-941-9388


Using ZipCode

ZipCode is extremely easy to use. It has three properties (City, State,  and ZipCodeFile) and one method (FindZipCode).

ZipCode looks up a zip code’s city and state using the supplied ZIPCODE.DAT data file. You must distribute this file with your application program. If ZIPCODE.DAT doesn’t reside in the current directory while the application program is running, you must provide the complete pathname for the data file by setting the ZipCodeFile property.

To look up a zip code’s city and state, simply pass the zip code to the ZipCode control using the FindZipCode method. Providing the zip code is found, ZipCode will set the City and State properties appropriately. If the zip code is not found, these properties are set to empty strings.


City Property

Property Name: City

Property Type: String

The City property will hold the name of the city for a zip code that is passed to the FindZipCode method.

See Also: FindZipCode and State Property


FindZipCode Method

Method Name: FindZipCode

Visual Basic Syntax: FindZipCode zip as Long

Delphi Syntax: Procedure FindZipCode(zip : LongInt);

The FindZipCode method is used to pass a zip code to the ZipCode control. If the zip code is found in ZIPCODE.DAT, the ZipCode control will set the City and State properties appropriately. If the zip code isn’t found, the ZipCode control will set the City and State properties to empty strings.

See Also: City, State, and ZipCodeFile


State Property

Property Name: State

Property Type: String

The State property will hold the name of the state for a zip code that is passed to the FindZipCode method.

See Also: City and FindZipCode


ZipCodeFile Property

Property Name: ZipCodeFile

Property Type: String

The ZipCodeFile holds the pathname for the ZIPCODE.DAT file. If ZIPCODE.DAT will reside in a directory other than the current directory while the application program is running, you must set the ZipCodeFile property to ZIPCODE.DAT’s complete pathname before calling the

See Also: FindZipCode