Classic Computer Magazine Archive COMPUTE! ISSUE 124 / DECEMBER 1990 / PAGE G-21

So It's Your Birthday!

I am 72 and not at all interested in games, but I'm having trouble with a program that shouldn't be too complicated for you smart young fellows. I have a list of 86 names, addresses, and birthdays from my mailing label program, and I'd like a utility to go through the data and select the names and birthdays of all the people born in a particular month. It would be nice to have it print them to the screen or printer.

DON SHEA
LAKE CITY, FL

Here's a simple program that should do what you want, Don. It reads six pieces of information from data statements about each person. The first name, last name, address, phone number, and birth date are all single items; but notice that the city, state, and ZIP code are also listed as one item. For the program to work properly, make certain that you have six entries separated by commas for each data statement. Use a space if you need to leave an item blank.

Once you've entered your data statements, change the value of MAX in line 10 to equal the number of names on your list. Our sample program has only two people; therefore, MAX=2. If you have 86 names on your list, then MAX=86.

GM 10 MAX = 2 : DIM AS(MAX), B$(MAX), C$(MAX), D$(MAX), ES(MAX), F$(MAX), M0$(12)
GE 20 FORX = 0 TO 11 : READMO$(X) : NEXT
PK 30 FOR X = 0 TO MAX - 1 : READ AS(X), B$(X), C$(X), D$(X), E$(X), F$(X) : NEXT
FE 40 PRINT"{CLR}{WHT}{3 DOWN} ENTER MONTH (EXAMPLE : JAN)" ; : INPUT M$
FD 50 IF LEN(M$) > 3 THEN 40
MF 60 PRINT "{2 DOWN} PRESS (P) FOR PRINTER OR"
PQ 70 PRINT "{7 SPACES}(S) FOR {SPACE} SCREEN OUTPUT"
ME 80 GET P$ : IF P$ = "" THEN 80
PB 90 FORX = 0 TO 11 : IF M$ = MO$(X) {SPACE} THEN 120
MH 100 NEXT
CM 110 GOTO 40
KM 120 FOR X = 0 TO MAX - 1 : IF LEFT$ (F$(X), 3) = M$ THEN GOSUB 170
XJ 130 NEXT : PRINT "{2 DOWN} {RVS} PRESS ANY KEY {OFF} "
ER 140 GETA$ : IFA$ = ""THEN 140
CR 150 GOTO40
BG 160 REM ** PRINT ROUTINE **
KB 170 IF P$ = "P" THENOPEN4, 4 : CM D4
SX 180 PRINT : PRINT
RJ 190 PRINT"NAME : {2 SPACES}" ; A$(X) ; " " ; B$(X)
XD 200 PRINT "ADDR : {2 SPACES}" ; C$(X)
BK 210 PRINT "{7 SPACES}" ; D$(X}
CD 220 PRINT "PHONE : " ; E$(X)
PP 230 PRINT "B'DAY : " ; F$(X)
RA 240 IF P$ = "P" THEN PRINT # 4 : CLOSE 4
SG 250 RETURN
SX 260 REM ** NAMES **
PC 270 DATA JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
PF 280 DATA JOHN A., DOE, RT 1 BOX 123, SILER CITY NC 27 344, 555-0123, AUG 31
KD 290 DATA JANE B., EDWARDS, RT 2 BOX 334, PLANT CITY FL 32055, 555-9876, JAN 10
KC 999 DATA JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
JS 1000 DATA JOHN A., DOE, RT 1 {SPACE}BOX 123, SILER CITY NC 27344, 555-0123, AUG 31
EM 1001 DATA JANE B., EDWARDS, RT 2 BOX 334, PLANT CITY FL 32055, 555-9876, JAN 10