home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / busi / acode10.zip / AREACODE.PAS < prev   
Pascal/Delphi Source File  |  1989-10-20  |  13KB  |  296 lines

  1.  
  2.   {========================================================================}
  3.   {                                                                        }
  4.   { If you find this program useful, please support the SHAREWARE system   }
  5.   { by sending a small donation ( up to $5 ) to help with my college       }
  6.   { education. Reguardless of a donation, use the program in good health   }
  7.   { (and with a clear concious), I hope you find it useful.                }
  8.   {                                                                        }
  9.   {                                                                        }
  10.   { Send Any Replies To:  EUROPA Software                                  }
  11.   {                       314 Pleasant Meadows Dr.                         }
  12.   {                       Gaffney, SC 29340                                }
  13.   {                                                                        }
  14.   { Program: AreaCode v.01                         Last Revised: 10/26/89  }
  15.   {                                                                        }
  16.   { Author: Jay Clary                                                      }
  17.   {                                                                        }
  18.   {                                                                        }
  19.   { Implementation: Turbo Pascal v.4.0 & v.5.0                             }
  20.   {                                                                        }
  21.   { Purpose: To provide a quick cross reference of area code information.  }
  22.   {                                                                        }
  23.   { Usage: Interactive  - AreaCode.EXE then follow the prompts             }
  24.   {                                                                        }
  25.   {        Command Line - AreaCode.EXE [area code to search for]           }
  26.   {                       AreaCode.EXE [state abbreviation to search for]  }
  27.   {                                                                        }
  28.   {                                                                        }
  29.   {=========================   DISCALIMER   ===============================}
  30.   {                                                                        }
  31.   {    This program is provided AS IS. EUROPA Software nor any of its      }
  32.   {    employees shall be held liable for any incidental or consequential  }
  33.   {    damage attributed to the use, or inability to use this product.     }
  34.   {                                                                        }
  35.   {========================================================================}
  36.  
  37.  
  38. {$A-,B-,D-,E-,F-,I-,L-,N-,O-,R-,S-,V-}
  39. {$M 1024,0,640000}
  40.  
  41. program areacode;
  42.  
  43.  
  44.    type acodes = record
  45.  
  46.         c  :  integer;
  47.         a  :  string[2];
  48.         d  :  string[52];
  49.  
  50.    end;
  51.  
  52.    const all_codes : array[1..144] of acodes = (
  53.  
  54. ( c : 201; a : 'NJ'; d : 'New Jersey (Newark, Hackensack, New Brunswick)'   ),
  55. ( c : 201; a : 'NJ'; d : 'New Jersey (Patterson)'   ),
  56. ( c : 202; a : 'DC'; d : 'Washington DC'   ),
  57. ( c : 203; a : 'CT'; d : 'Connecticut'   ),
  58. ( c : 204; a : 'CN'; d : 'Canada (Manitoba)'   ),
  59. ( c : 205; a : 'AL'; d : 'Alabama'   ),
  60. ( c : 206; a : 'WA'; d : 'Washington (Seattle, Olympia, Vancouver)'   ),
  61. ( c : 207; a : 'ME'; d : 'Maine'   ),
  62. ( c : 208; a : 'ID'; d : 'Idaho'   ),
  63. ( c : 209; a : 'CA'; d : 'California (Fresno'   ),
  64. ( c : 212; a : 'NY'; d : 'New York (New York City)'   ),
  65. ( c : 213; a : 'CA'; d : 'California (Los Angeles)'   ),
  66. ( c : 214; a : 'TX'; d : 'Texas (Dallas, Ennis, Greenville, Jefferson)'   ),
  67. ( c : 214; a : 'TX'; d : 'Texas (Longview, Sherman, Tyler)'   ),
  68. ( c : 215; a : 'PA'; d : 'Pennsylvania (Philadelphia, Allentown)'   ),
  69. ( c : 216; a : 'OH'; d : 'Ohio (Akron, Cleveland, Youngstown)'   ),
  70. ( c : 217; a : 'IL'; d : 'Illinois (Springfield)'   ),
  71. ( c : 218; a : 'MN'; d : 'Minnesota (Duluth)'   ),
  72. ( c : 219; a : 'IN'; d : 'Indiana (Gary, South Bend, Warsaw)'   ),
  73. ( c : 301; a : 'MD'; d : 'Maryland'   ),
  74. ( c : 302; a : 'DE'; d : 'Delaware'   ),
  75. ( c : 303; a : 'CO'; d : 'Colorado'   ),
  76. ( c : 304; a : 'WV'; d : 'West Virginia'   ),
  77. ( c : 305; a : 'FL'; d : 'Florida (Miami, Key West, Ft. Lauderdale)'   ),
  78. ( c : 306; a : 'CN'; d : 'Canada (Saskatchewan)'   ),
  79. ( c : 307; a : 'WY'; d : 'Wyomin'   ),
  80. ( c : 308; a : 'NE'; d : 'Nebraska (North Platte)'   ),
  81. ( c : 309; a : 'IL'; d : 'Illinois (Peoria)'   ),
  82. ( c : 312; a : 'IL'; d : 'Illinois (Chicago, Aurora, Waukegan)'   ),
  83. ( c : 313; a : 'MI'; d : 'Michigan (Detroit, Ann Arbor, Flint)'   ),
  84. ( c : 314; a : 'MO'; d : 'Missouri (St. Louis, Cape Girardeau, Columbia)'   ),
  85. ( c : 314; a : 'MO'; d : 'Missouri (Fulton, Hannibal, Jefferson City)'   ),
  86. ( c : 314; a : 'MO'; d : 'Missouri (Mexico, Poplar Bluff, Rolla)'   ),
  87. ( c : 315; a : 'NY'; d : 'New York (Syracuse)'   ),
  88. ( c : 316; a : 'KS'; d : 'Kansas (Wichita, Dodge City)'   ),
  89. ( c : 317; a : 'IN'; d : 'Indiana (Indianapolis, Kokomo)'   ),
  90. ( c : 318; a : 'LA'; d : 'Louisiana (Lake Charles)'   ),
  91. ( c : 319; a : 'IA'; d : 'Iowa (Dubuque)'   ),
  92. ( c : 401; a : 'RI'; d : 'Rhode Island'   ),
  93. ( c : 402; a : 'NE'; d : 'Nebraska (Omaha, Lincoln)'   ),
  94. ( c : 403; a : 'CN'; d : 'Canada (Alberta -- Calgary, Edmonton)'   ),
  95. ( c : 404; a : 'GA'; d : 'Georgia (Atlanta, Rome)'   ),
  96. ( c : 405; a : 'OK'; d : 'Oklahoma (Oklahoma City, Enid, Norman)'   ),
  97. ( c : 405; a : 'OK'; d : 'Oklahoma (Ponca City, Stillwater)'   ),
  98. ( c : 406; a : 'MT'; d : 'Montana'   ),
  99. ( c : 408; a : 'CA'; d : 'California (San Jose)'   ),
  100. ( c : 409; a : 'TX'; d : 'Texas (Bay City, Beaumont, Bryan)'   ),
  101. ( c : 409; a : 'TX'; d : 'Texas (College Station, Galveston, Huntsville)'   ),
  102. ( c : 412; a : 'PA'; d : 'Pennsylvania (Pittsburgh)'   ),
  103. ( c : 413; a : 'MA'; d : 'Massachusetts (Springfield)'   ),
  104. ( c : 414; a : 'WI'; d : 'Wisconsin (Milwaukee, Green Bay, Racine)'   ),
  105. ( c : 415; a : 'CA'; d : 'California (San Francisco)'   ),
  106. ( c : 416; a : 'CN'; d : 'Canada (Ontario -- Toronto, Mississauga)'   ),
  107. ( c : 417; a : 'MO'; d : 'Missouri (Joplin, Springfield)'   ),
  108. ( c : 418; a : 'CN'; d : 'Canada (Quebec)'   ),
  109. ( c : 419; a : 'OH'; d : 'Ohio (Toledo)'   ),
  110. ( c : 501; a : 'AR'; d : 'Arkansas'   ),
  111. ( c : 502; a : 'KY'; d : 'Kentucky (Louisville, Frankfort)'   ),
  112. ( c : 502; a : 'KY'; d : 'Kentucky (Paducah, Shelbyville)'   ),
  113. ( c : 503; a : 'OR'; d : 'Oregon'   ),
  114. ( c : 504; a : 'LA'; d : 'Louisiana (Baton Rouge, New Orleans)'   ),
  115. ( c : 505; a : 'NM'; d : 'New Mexico'   ),
  116. ( c : 506; a : 'CN'; d : 'Canada (New Brunswick -- Costa Rica)'   ),
  117. ( c : 507; a : 'MN'; d : 'Minnesota (Rochester)'   ),
  118. ( c : 509; a : 'WA'; d : 'Washington (Walla Walla)'   ),
  119. ( c : 512; a : 'TX'; d : 'Texas (Austin, Brownsville, Corpus Christi, Del Rio)'   ),
  120. ( c : 512; a : 'TX'; d : 'Texas (Eagle Pass,Laredo, McAllen, San Antonio)'   ),
  121. ( c : 512; a : 'TX'; d : 'Texas (Victoria)'   ),
  122. ( c : 513; a : 'OH'; d : 'Ohio (Cincinnati, Dayton)'   ),
  123. ( c : 514; a : 'CN'; d : 'Canada (Quebec -- Montreal)'   ),
  124. ( c : 515; a : 'IA'; d : 'Iowa (Des Moines)'   ),
  125. ( c : 516; a : 'NY'; d : 'New York'   ),
  126. ( c : 517; a : 'MI'; d : 'Michigan (Lansing)'   ),
  127. ( c : 518; a : 'NY'; d : 'New York (Albany, Schenectady)'   ),
  128. ( c : 519; a : 'CN'; d : 'Canada (Ontario -- London)'   ),
  129. ( c : 601; a : 'MS'; d : 'Mississippi'   ),
  130. ( c : 602; a : 'AZ'; d : 'Arizona'   ),
  131. ( c : 603; a : 'NH'; d : 'New Hampshire'   ),
  132. ( c : 604; a : 'CN'; d : 'Canada (British Columbia -- Vancouver)'   ),
  133. ( c : 605; a : 'SD'; d : 'South Dakota'   ),
  134. ( c : 606; a : 'KY'; d : 'Kentucky (Winchester)'   ),
  135. ( c : 607; a : 'NY'; d : 'New York (Binghamton)'   ),
  136. ( c : 608; a : 'WI'; d : 'Wisconsin (Madison)'   ),
  137. ( c : 609; a : 'NJ'; d : 'New Jersey (Atlantic City, Camden, Trenton)'   ),
  138. ( c : 612; a : 'MN'; d : 'Minnesota (Minneapolis, St. Paul)'   ),
  139. ( c : 613; a : 'CN'; d : 'Canada (Ontario -- Ottawa)'   ),
  140. ( c : 614; a : 'OH'; d : 'Ohio (Columbus)'   ),
  141. ( c : 615; a : 'TN'; d : 'Tennessee (Nashville, Chattanooga)'   ),
  142. ( c : 616; a : 'MI'; d : 'Michigan (Battle Creek, Grand Rapids, Kalamazoo)'   ),
  143. ( c : 617; a : 'MA'; d : 'Massachusetts (Boston, New Bedford, Plymouth)'   ),
  144. ( c : 617; a : 'MA'; d : 'Massachusetts (Worchester)'   ),
  145. ( c : 618; a : 'IL'; d : 'Illinois (Alton, Mt. Vernon)'   ),
  146. ( c : 619; a : 'CA'; d : 'California (San Diego)'   ),
  147. ( c : 701; a : 'ND'; d : 'North Dakota'   ),
  148. ( c : 702; a : 'NV'; d : 'Nevada'   ),
  149. ( c : 703; a : 'VA'; d : 'Virginia (Roanoke, Winchester)'   ),
  150. ( c : 704; a : 'NC'; d : 'North Carolina (Charlotte, Salisbury)'   ),
  151. ( c : 705; a : 'CN'; d : 'Canada (West Ontario)'   ),
  152. ( c : 706; a : 'MX'; d : 'Mexico (NW Mexico)'   ),
  153. ( c : 707; a : 'CA'; d : 'California (Santa Rosa)'   ),
  154. ( c : 709; a : 'CN'; d : 'Canada (Newfoundland)'   ),
  155. ( c : 712; a : 'IA'; d : 'Iowa (Council Bluffs)'   ),
  156. ( c : 713; a : 'TX'; d : 'Texas (Houston, Baytown, Pasadena)'   ),
  157. ( c : 714; a : 'CA'; d : 'California (Orange)'   ),
  158. ( c : 715; a : 'WI'; d : 'Wisconsin (Wausau)'   ),
  159. ( c : 716; a : 'NY'; d : 'New York (Buffalo, Niagara Falls, Rochester)'   ),
  160. ( c : 717; a : 'PA'; d : 'Pennsylvania (Harrisburg, Scranton)'   ),
  161. ( c : 718; a : 'NY'; d : 'New York (New York City)'   ),
  162. ( c : 800; a : '  '; d : 'Wide Area Telephone Service (WATS)'   ),
  163. ( c : 801; a : 'UT'; d : 'Utah'   ),
  164. ( c : 802; a : 'VT'; d : 'Vermont'   ),
  165. ( c : 803; a : 'SC'; d : 'South Carolina'   ),
  166. ( c : 804; a : 'VA'; d : 'Virginia (Charlottesville, Newport News)'   ),
  167. ( c : 804; a : 'VA'; d : 'Virginia (Norfolk, Richmond)'   ),
  168. ( c : 805; a : 'CA'; d : 'California (Bakersfield)'   ),
  169. ( c : 806; a : 'TX'; d : 'Texas (Amarillo, Dalhart, Lubbock)'   ),
  170. ( c : 807; a : 'CN'; d : 'Canada (East Ontario)'   ),
  171. ( c : 809; a : 'PR'; d : 'Puerto Rico (Anguilla, Antigua, Bahamas, Barbados)'   ),
  172. ( c : 809; a : 'PR'; d : 'Puerto Rico (Bermuda, Cayman Islands)'   ),
  173. ( c : 809; a : 'PR'; d : 'Puerto Rico (Dominican Republic, Jamaica)'   ),
  174. ( c : 809; a : 'PR'; d : 'Puerto Rico (St. Lucia, Trinidad)'   ),
  175. ( c : 812; a : 'IN'; d : 'Indiana (Evansville)'   ),
  176. ( c : 813; a : 'FL'; d : 'Florida (Ft. Myers, Winter Haven)'   ),
  177. ( c : 814; a : 'PA'; d : 'Pennsylvania (Erie)'   ),
  178. ( c : 815; a : 'IL'; d : 'Illinois (Rockford)'   ),
  179. ( c : 816; a : 'MO'; d : 'Missouri (Belton, Independence, Kansas City)'   ),
  180. ( c : 816; a : 'MO'; d : 'Missouri (Marshall, St. Joseph, Sedalia)'   ),
  181. ( c : 817; a : 'TX'; d : 'Texas (Fort Worth, Denton, Temple)'   ),
  182. ( c : 817; a : 'TX'; d : 'Texas (Waco, Wichita Falls)'   ),
  183. ( c : 819; a : 'CN'; d : 'Canada (NW Quebec)'   ),
  184. ( c : 901; a : 'TN'; d : 'Tennessee (Memphis)'   ),
  185. ( c : 902; a : 'CN'; d : 'Canada (Nova Scotia & Prince Edward Island)'   ),
  186. ( c : 904; a : 'FL'; d : 'Florida (Jacksonville)'   ),
  187. ( c : 905; a : 'MX'; d : 'Mexico (Mexico City)'   ),
  188. ( c : 906; a : 'MI'; d : 'Michigan (906 Escanaba)'   ),
  189. ( c : 907; a : 'AK'; d : 'Alaska'   ),
  190. ( c : 912; a : 'GA'; d : 'Georgia (Waycross)'   ),
  191. ( c : 913; a : 'KS'; d : 'Kansas (Topeka, Lawrence, Manhattan, Salina)'   ),
  192. ( c : 914; a : 'NY'; d : 'New York (White Plains)'   ),
  193. ( c : 915; a : 'TX'; d : 'Texas (Abilene, Alpine, Big Spring, El Paso)'   ),
  194. ( c : 915; a : 'TX'; d : 'Texas (Midland, Odessa)'   ),
  195. ( c : 916; a : 'CA'; d : 'California (Sacramento)'   ),
  196. ( c : 918; a : 'OK'; d : 'Oklahoma (Tulsa, Bartlesville, McAlester, Muskogee)'   ),
  197. ( c : 919; a : 'NC'; d : 'North Carolina ' ) );
  198.  
  199.        n1 = 'AreaCode v.01 - (c) Copyright 1989 Europa Software';
  200.  
  201.        t0 = 'No Entry for ';
  202.        t1 = 'Enter the Area Code or the State Abbreviation (0 to end) :  ';
  203.        t2 = 'Used By: ';
  204.        t3 = 'Area Code: ';
  205.        t4 = 'State Abbreviation: ';
  206.  
  207.  
  208.    var i,j,sv,y  :  integer;
  209.        s1      :  string[80];
  210.        found   :  boolean;
  211.  
  212.    begin
  213.  
  214.  
  215.       writeln;
  216.       writeln;
  217.       writeln( n1 );
  218.  
  219.       repeat
  220.  
  221.          if paramcount = 0 then begin
  222.  
  223.             writeln;
  224.             write( t1 );
  225.             readln( s1 );
  226.  
  227.          end
  228.          else s1 := paramstr(1);
  229.  
  230.          for i := 1 to length(s1) do s1[i] := upcase(s1[i]);
  231.          writeln;
  232.  
  233.  
  234.          val( s1, sv, i );
  235.  
  236.          if i = 0 then begin
  237.  
  238.             if sv = 0 then exit;
  239.             writeln('Search For Area Code: ', s1 );
  240.             writeln;
  241.  
  242.             i := 1;
  243.             y := 24;
  244.             found := false;
  245.  
  246.             repeat
  247.  
  248.                if sv = all_codes[i].c then begin
  249.  
  250.                   writeln( t2, all_codes[i].d );
  251.                   found := true;
  252.                   inc(y);
  253.  
  254.                end;
  255.  
  256.                inc(i);
  257.  
  258.             until ( i > 144 );
  259.  
  260.             if (NOT found) then writeln( t0, t3, sv );
  261.             writeln;
  262.  
  263.          end
  264.          else begin
  265.  
  266.             writeln('Searching Area Codes in: ', s1 );
  267.             writeln;
  268.             i := 1;
  269.             found := false;
  270.  
  271.             repeat
  272.  
  273.                if s1 = all_codes[i].a then begin
  274.  
  275.                   writeln( t3, all_codes[i].c, ' - ', all_codes[i].d );
  276.                   found := true;
  277.  
  278.                end;
  279.  
  280.                inc(i);
  281.  
  282.             until ( i > 144 );
  283.  
  284.             if (NOT found) then writeln( t0, t4, s1 );
  285.             writeln;
  286.  
  287.          end
  288.  
  289.  
  290.       until (paramcount > 0);
  291.  
  292.    end.
  293.  
  294.  
  295.  
  296.