** Last revision: April 17, 1986 at 18:54 * phone.ag * this module makes a phone list of names, home and office phones * it can be adjusted to print otherwise information SET MARGIN TO 10 * GET a starting AND ending points in FILES STOR 'A' TO stletter @ 17,12 SAY 'Letter of alphabet at which to start report' @ 17,57 GET stletter PICTURE '!' READ STOR 'Z' TO llet @ 18,12 SAY 'Letter of alphabet at which to end report' @ 18,57 GET llet PICTURE '!' READ STOR ASC(llet)+1 TO finish * goto starting point or next if no find IF stletter = 'A' GO TOP ELSE SEEK stletter DO WHIL (EOF() .OR. BOF()) STOR ASC(stletter) + 1 TO start1 STOR CHR(start1) TO stletter SEEK stletter ENDD whil # ENDI stletter * initialize variables STOR 0 TO pageno STOR .t. TO more SET MARGIN TO 10 DO WHIL more * do page counter etc STOR pageno + 1 TO pageno STOR 6 TO lineno CLEAR * eject a page and skip down 2 lines IF printer = 'Y' SET PRINT ON EJEC ENDIF * and write title ? '========================== TELEPHONE LIST ==========================' ? ' ' ? ' ' + DTOC(DATE()) + ' PAGE: ' + str(pageno,2) ? ' ' ? ' NAME HOME PHONE OFFICE PHONE' ? ' ' * now fill up restore of page to 55 lines with names etc DO WHIL lineno < 55 * now do a page if not end of files IF .not. EOF() IF ASC(lastname) <= finish * make first name to length=10 and... * create a blank to pad names to constant length STOR trim(fname)+ ' ' + lastname TO mname STOR SUBSTR(mname,1,23) TO mname ? mname+ ' ' + phone + ' ' + ophone * if it is end of files quit STOR lineno +1 TO lineno SKIP * if deleted, skip again IF DELETE() SKIP ENDI ELSE SKIP ENDI $(lastname) ELSE STOR .f. TO more STOR 60 TO lineno ENDI not eof ENDD WHILE lineno < 55 ENDD more * if it was on turn it off IF printer = 'Y' EJEC ENDIF SET MARGIN TO 0 SET PRINT OFF SET ALTERNATE OFF SET MARGIN TO 0 RETURN