home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
files
/
bbs
/
pibterm
/
pibt3sp1
/
getareac.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-09-02
|
18KB
|
364 lines
OVERLAY PROCEDURE GetAreaCode;
(*--------------------------------------------------------------------------*)
(* *)
(* Procedure: GetAreaCode *)
(* *)
(* Purpose: Searches area code directory *)
(* *)
(* Calling sequence: *)
(* *)
(* GetAreaCode; *)
(* *)
(* Calls: *)
(* *)
(* UpperCase *)
(* Save_Screen *)
(* Draw_Menu_Frame *)
(* Restore_Screen *)
(* Reset_Global_Colors *)
(* *)
(* Called by: Execute_Command *)
(* *)
(* Credit: This area code search is based upon one by Tom Hanlin III *)
(* in his ETERM and PASCTERM programs, and one by Martin Smith *)
(* in his AREA2.EXE program. *)
(* *)
(*--------------------------------------------------------------------------*)
CONST
MaxAreaCodes = 251;
CONST
AreaCode: ARRAY[0..MaxAreaCodes] OF STRING[60] =
( '201NJNew Jersey (Newark, Hackensack, New Brunswick)',
'201NJNew Jersey (Patterson)',
'202DCWashington DC',
'203CTConnecticut',
'204CNCanada (Manitoba)',
'205ALAlabama',
'206WAWashington (Seattle, Olympia, Vancouver)',
'207MEMaine',
'208IDIdaho',
'209CACalifornia (Fresno)',
'212NYNew York (New York City)',
'213CACalifornia (Los Angeles)',
'214TXTexas (Dallas, Ennis, Greenville, Jefferson)',
'214TXTexas (Longview, Sherman, Tyler)',
'215PAPennsylvania (Philadelphia, Allentown)',
'216OHOhio (Akron, Cleveland, Youngstown)',
'217ILIllinois (Springfield)',
'218MNMinnesota (Duluth)',
'219INIndiana (Gary, South Bend, Warsaw)',
'301MDMaryland',
'302DEDelaware',
'303COColorado',
'304WVWest Virginia',
'305FLFlorida (Miami, Key West, Ft. Lauderdale)',
'306CNCanada (Saskatchewan)',
'307WYWyoming',
'308NENebraska (North Platte)',
'309ILIllinois (Peoria)',
'312ILIllinois (Chicago, Aurora, Waukegan)',
'313MIMichigan (Detroit, Ann Arbor, Flint)',
'314MOMissouri (St. Louis, Cape Girardeau, Columbia)',
'314MOMissouri (Fulton, Hannibal, Jefferson City)',
'314MOMissouri (Mexico, Poplar Bluff, Rolla)',
'315NYNew York (Syracuse)',
'316KSKansas (Wichita, Dodge City)',
'317INIndiana (Indianapolis, Kokomo)',
'318LALouisiana (Lake Charles)',
'319IAIowa (Dubuque)',
'401RIRhode Island',
'402NENebraska (Omaha, Lincoln)',
'403CNCanada (Alberta -- Calgary, Edmonton)',
'404GAGeorgia (Atlanta, Rome)',
'405OKOklahoma (Oklahoma City, Enid, Norman)',
'405OKOklahoma (Ponca City, Stillwater)',
'406MTMontana',
'408CACalifornia (San Jose)',
'409TXTexas (Bay City, Beaumont, Bryan)',
'409TXTexas (College Station, Galveston, Huntsville)',
'412PAPennsylvania (Pittsburgh)',
'413MAMassachusetts (Springfield)',
'414WIWisconsin (Milwaukee, Green Bay, Racine)',
'415CACalifornia (San Francisco)',
'416CNCanada (Ontario -- Toronto, Mississauga)',
'417MOMissouri (Joplin, Springfield)',
'418CNCanada (Quebec)',
'419OHOhio (Toledo)',
'501ARArkansas',
'502KYKentucky (Louisville, Frankfort)',
'502KYKentucky (Paducah, Shelbyville)',
'503OROregon',
'504LALouisiana (Baton Rouge, New Orleans)',
'505NMNew Mexico',
'506CNCanada (New Brunswick -- Costa Rica)',
'507MNMinnesota (Rochester)',
'509WAWashington (Walla Walla)',
'512TXTexas (Austin, Brownsville, Corpus Christi, Del Rio)',
'512TXTexas (Eagle Pass, Laredo, McAllen, San Antonio)',
'512TXTexas (Victoria)',
'513OHOhio (Cincinnati, Dayton)',
'514CNCanada (Quebec -- Montreal)',
'515IAIowa (Des Moines)',
'516NYNew York',
'517MIMichigan (Lansing)',
'518NYNew York (Albany, Schenectady)',
'519CNCanada (Ontario -- London)',
'601MSMississippi',
'602AZArizona',
'603NHNew Hampshire',
'604CNCanada (British Columbia -- Vancouver)',
'605SDSouth Dakota',
'606KYKentucky (Winchester)',
'607NYNew York (Binghamton)',
'608WIWisconsin (Madison)',
'609NJNew Jersey (Atlantic City, Camden, Trenton)',
'612MNMinnesota (Minneapolis, St. Paul)',
'613CNCanada (Ontario -- Ottawa)',
'614OHOhio (Columbus)',
'615TNTennessee (Nashville, Chattanooga)',
'616MIMichigan (Battle Creek, Grand Rapids, Kalamazoo)',
'617MAMassachusetts (Boston, New Bedford, Plymouth)',
'617MAMassachusetts (Worchester)',
'618ILIllinois (Alton, Mt. Vernon)',
'619CACalifornia (San Diego)',
'701NDNorth Dakota',
'702NVNevada',
'703VAVirginia (Roanoke, Winchester)',
'704NCNorth Carolina (Charlotte, Salisbury)',
'705CNCanada (West Ontario)',
'706MXMexico (NW Mexico)',
'707CACalifornia (Santa Rosa)',
'709CNCanada (Newfoundland)',
'712IAIowa (Council Bluffs)',
'713TXTexas (Houston, Baytown, Pasadena)',
'714CACalifornia (Orange)',
'715WIWisconsin (Wausau)',
'716NYNew York (Buffalo, Niagara Falls, Rochester)',
'717PAPennsylvania (Harrisburg, Scranton)',
'718NYNew York (New York City)',
'800 Wide Area Telephone Service (WATS)',
'801UTUtah',
'802VTVermont',
'803SCSouth Carolina',
'804VAVirginia (Charlottesville, Newport News)',
'804VAVirginia (Norfolk, Richmond)',
'805CACalifornia (Bakersfield)',
'806TXTexas (Amarillo, Dalhart, Lubbock)',
'807CNCanada (East Ontario)',
'808HIHawaii',
'809PRPuerto Rico (Anguilla, Antigua, Bahamas, Barbados)',
'809PRPuerto Rico (Bermuda, Cayman Islands)',
'809PRPuerto Rico (Dominican Republic, Jamaica)',
'809PRPuerto Rico (St. Lucia, Trinidad)',
'812INIndiana (Evansville)',
'813FLFlorida (Ft. Myers, Winter Haven)',
'814PAPennsylvania (Erie)',
'815ILIllinois (Rockford)',
'816MOMissouri (Belton, Independence, Kansas City)',
'816MOMissouri (Marshall, St. Joseph, Sedalia)',
'817TXTexas (Fort Worth, Denton, Temple)',
'817TXTexas (Waco, Wichita Falls)',
'819CNCanada (NW Quebec)',
'901TNTennessee (Memphis)',
'902CNCanada (Nova Scotia & Prince Edward Island)',
'904FLFlorida (Jacksonville)',
'905MXMexico (Mexico City)',
'906MIMichigan (906 Escanaba)',
'907AKAlaska',
'912GAGeorgia (Waycross)',
'913KSKansas (Topeka, Lawrence, Manhattan, Salina)',
'914NYNew York (White Plains)',
'915TXTexas (Abilene, Alpine, Big Spring, El Paso)',
'915TXTexas (Midland, Odessa)',
'916CACalifornia (Sacramento)',
'918OKOklahoma (Tulsa, Bartlesville, McAlester, Muskogee)',
'919NCNorth Carolina (Greenville, Raleigh, Winston-Salem)',
' Algeria 213',
' Argentina 54',
' Australia 61 Adelaide, Melbourne',
' Australia 61 Newcastle',
' Australia 61 South Perth, Spring Hill',
' Australia 61 Sydney',
' Austria 43 Vienna',
' Barbados 809',
' Belgium 32 Brussels',
' Bolivia 591',
' Braddon 616',
' Brazil 55l',
' Cameroons 237',
' Chile 056',
' Columbia 287 Bogota',
' Costa Rica 506',
' Cyprus 357',
' Denmark 45 Copenhagen',
' Dutch Antilles 599',
' Egypt 20',
' El Salvador 503',
' Ecuador 593',
' England --- see United Kingdom',
' Ethiopia 251',
' Finland 358 Helsinki',
' France 33',
' French Antilles 596',
' French Polyesia 589',
' Fiji 679',
' Gabon 241',
' Germany (East) 37',
' Germany (West) 49 Duesseldorf, Frankfurt',
' Germany (West) 49 Hamburg, Hannover',
' Germany (West) 49 Muenchen, Stuttgart',
' Greece 030',
' Guam 671',
' Guantanamo 53',
' Guatemala 502',
' Guyana 592',
' Haiti 509',
' Honduras 504',
' Hong Kong 852',
' Iceland 354',
' India 242',
' Indonesia 062',
' Iran 98',
' Iraq 964',
' Ireland 353 Dublin',
' Israel 972',
' Italy 39 Bologna, Firenze, Milan',
' Italy 39 Padua, Rome, Turin',
' Ivory Coast 225',
' Japan 81 Gyoda, Nagoya, Osaka, Tokyo',
' Jordan 431',
' Kenya 254',
' Korea 82',
' Kuwait 965',
' Lebanon 961',
' Liberia 231',
' Libya 218',
' Lichtenstein 41',
' Luxembourg 352',
' Malawi 265',
' Malaysia 60',
' Mexico 052',
' Monaco 33 (shared with France)',
' Morocco 212',
' Netherlands 31 Amsterdam, Badhoevedorp',
' Netherlands 31 Rijswijk, Zwolle',
' New Caledonia 687',
' New Zealand 64 Auckland, Wellington',
' Nicaragua 505',
' Nigeria 234',
' Norway 47 Oslo',
' Oman 968',
' Pakistan 92',
' Panama 507',
' Paraguay 595',
' Peru 51',
' Philippines 63',
' Portugal 351',
' Qatar 974',
' Romania 40',
' Saudi Arabia 966',
' Senegal 221',
' Singapore 65',
' South Africa 27 Johannesburg',
' Spain 34 Barcelona, Madrid',
' Sri Lanka 94',
' St. Denis 331',
' Surinam 597',
' Sweden 46 Gothenborg, Malmoe',
' Sweden 46 Stockholm',
' Switzerland Bern, Lausanne, Zurich',
' Taiwan 886',
' Thailand 66',
' Tunisia 216',
' Turkey 90',
' United Arab Emirates 971 Arabia',
' United Kingdom 44 Birmingham, Bristol',
' United Kingdom 44 Hounslow, Leeds, London',
' United Kingdom 44 Manchester, Middlesex',
' United Kingdom 44 Paisley',
' Uruguay 598',
' Vatican City 39 (Shared with Italy)',
' Venezuela 58 Codata',
' Yugoslavia 38'
);
VAR
LF: BYTE;
RT: BYTE;
Ptr: BYTE;
I: BYTE;
Code: STRING[20];
Any_Ch: CHAR;
BEGIN (* GetAreaCode *)
(* Save current screen *)
Save_Screen( Saved_Screen );
(* Display area code prompt box *)
Draw_Menu_Frame( 5, 4, 75, 23, Menu_Frame_Color,
Menu_Text_Color, 'Area code search' );
(* Prompt for and read area code req. *)
WRITE('Enter area code, state/country, or state initials: ');
READLN( Code );
RT := LENGTH( Code );
(* Convert to upper case *)
Code := UpperCase( Code );
(* Determine type of request *)
IF ( RT = 2 ) AND
( Code[1] IN ['A'..'Z']) AND ( Code[2] IN ['A'..'Z'] ) THEN
LF := 4
ELSE IF ( RT = 3 ) AND
( Code[1] IN ['0'..'9'] ) AND
( Code[2] IN ['0'..'9'] ) AND
( Code[3] IN ['0'..'9'] ) THEN
LF := 1
ELSE IF RT <> 0 THEN
LF := 6;
(* Display search message *)
Draw_Menu_Frame( 5, 4, 75, 23, Menu_Frame_Color,
Menu_Text_Color, 'Searching for: ' + Code );
(* Perform search *)
View_Count := 0;
View_Done := FALSE;
FOR I := 0 TO MaxAreaCodes DO
IF ( NOT View_Done ) THEN
IF UpperCase( Copy( AreaCode[I], LF, RT ) ) = Code THEN
BEGIN
WRITE ( ' ' );
WRITE ( Copy( AreaCode[I], 1, 3 ), ' ' );
WRITE ( Copy( AreaCode[I], 4, 2 ) ,' ' );
WRITELN( Copy( AreaCode[I], 6, LENGTH( AreaCode[I] ) - 5 ) );
View_Count := View_Count + 1;
IF View_Count > 16 THEN
View_Prompt( View_Done, View_Count );
END;
RvsVideoOn ( Menu_Text_Color , BackGround_Color );
WRITE('Search complete. Hit any key to continue.');
RvsVideoOff( Menu_Text_Color , BackGround_Color );
READ( Kbd, Any_Ch );
IF ( Any_Ch = CHR( ESC ) ) AND KeyPressed THEN
READ( Kbd, Any_Ch );
(* Restore previous screen *)
Restore_Screen( Saved_Screen );
Reset_Global_Colors;
END (* GetAreaCode *);
ə