¢ AREA CODE 1997¢ By Frank Walters¢ ¢ This utility program displays the¢ State or Province (Canada) and¢ selected cities for each telephone¢ area code entered. Press [Return] at¢ the prompt to end program.¢ ¢ The purpose of this text file is to¢ explain how to update the program to¢ add new area codes as they become¢ available. The program uses RESTORE,¢ READ and DATA functions of BASIC to¢ find the area code information. The¢ line numbers represent AREA CODES so¢ this program should never be¢ re-numbered.¢ ¢ The main program is in lines 10-70,¢ with a continuous loop between 20 and¢ 70. The user inputs the area code¢ into AC$. AC$ is converted from¢ string variable to a numeric variable¢ with V=VAL(AC$) expression.¢ ¢ Line 50 RESTORE V will reset data¢ pointer to first DATA line beginning¢ with desired area code. Here is the¢ format of each data line:¢ ¢ LINE NUMBER is the AREA CODE.¢ DATA items start with a number¢ representing total number of DATA¢ items FOLLOWING the number. The next¢ item is the STATE or PROVINCE name in¢ upper case, followed by a comma and a¢ space. All additional items are city¢ names in Upper/lower case, preceeded¢ by a space in order to indent the¢ city list below the state name on¢ screen. Example:¢ ¢ 315 DATA 3,NEW YORK, Syracuse, Utica¢ ¢ Area Code 315 contains 3 DATA items¢ after the "3" item: NEW YORK state¢ followed by two cities. Therefore the¢ first DATA item is the number "3".¢ ¢ In order to protect the RESTORE¢ method from invalid area code inputs,¢ you must preceed each group of valid¢ line numbers with a "nothing" line:¢ ¢ 200 DATA 1,nothing¢ ¢ Any number equal to or less than 200¢ will READ line 200 and display the¢ "nothing" information. In other¢ words, any blank line (no area code)¢ must have a similar DATA entry like¢ line 200. In the case of a sequence¢ of invalid line numbers, only the¢ highest invalid line needs the DATA¢ statement as above since the RESTORE¢ statement will restore the pointer to¢ the first DATA line following the¢ input number.¢ ¢ To add a new area code to the¢ program, simply add a new line number¢ with that area code. Follow the¢ sequence of the other lines with a¢ "number", STATE or PROVINCE, and City¢ or list of selected cities. Make the¢ number equal to the total cities plus¢ one for the state name. Don't forget¢ the SPACE in front of each City name.¢ If the line number one less than the¢ new area code is missing, then add a¢ new line with the DATA exactly as in¢ line 200.¢ ¢ EXAMPLE:¢ ¢ 275 DATA,4,STATE, City1, City2, Town¢ ¢ Line 274 is missing so we must add:¢ ¢ 274 DATA 1,nothing¢ ¢ For standardization purposes, the¢ cities are listed in alphabetical¢ order in each DATA line.¢ ¢ Area code 275 will then look like¢ this on screen after user entry:¢ ¢ Area Code: 275¢ ¢ STATE¢ City1¢ City2¢ Town¢ ¢ You may have to edit the cities in¢ other DATA lines when new area codes¢ are added, since one area is often¢ divided into two new ones.¢ ¢ Just change the date in line 2 when¢ changes are made.¢ ¢ Frank Walters¢ T.A.C.O. Bell BBS¢ 03/20/97¢ ¢ o=o=o=o=o=¢