* DATE 04/09/85 17:45 * report.bk STOR t TO more DO WHIL more STOR CHR(PEEK (063)) TO dr REST from bdata additive ERAS STOR 'Y' TO printer STOR 'N' TO disk STOR ' ' TO filename STOR '?' TO command @ 2, 0 SAY "----------------------------------------" @ 2,39 SAY "----------------------------------------" @ 2,22 SAY "> > > R E P O R T M E N U < < <" @ 5,25 SAY "A. Prepare report by all books in file" @ 07,25 SAY "B. Prepare report based upon variables" @ 09,25 SAY "C. Prepare WordStar MailMerge file" @ 11,25 SAY "D. Display Records on screen" @ 13,25 SAY "E. Return to Main Menu" @ 17, 0 SAY "----------------------------------------" @ 17,39 SAY "----------------------------------------" @ 18,30 SAY "WHAT NEXT" @ 18,40 GET command PICTURE '!' READ IF command ='A' @ 19,22 SAY "Send Report to the Printer (Y/N)" @ 19,55 GET printer PICTURE '!' READ @ 20,22 SAY "Send Report to a Disk File (Y/N)" @ 20,55 GET disk PICTURE '!' READ IF disk ='Y' @ 21,22 SAY "Enter Disk File Name" @ 21,44 GET filename PICTURE '!!!!!!!!' @ 21,54 SAY "(.TXT will be added )" READ @ 21,00 @ 21,22 SAY 'Select drive to put Files on (A=left B=right) ' GET dr PICTURE '!' READ DO WHIL @(dr,'AB') = 0 @ 21,00 @ 21,22 SAY 'Select drive to put Files on (A=left B=right) ' GET dr PICTURE '!' READ ENDD ENDI STOR ' ' TO caption STOR 'Y' TO again @ 18,00 @ 19,00 @ 20,00 @ 21,00 @ 19,12 SAY 'Please State the Caption of the Report (do not center):' @ 20,10 GET caption PICTURE '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' READ @ 21,15 SAY 'Is the caption correct ?' @ 21,44 GET again PICTURE '!' READ IF again = 'N' @ 20,10 GET caption PICTURE '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' READ ENDI again STOR ' ' TO pad STOR TRIM(caption) TO caption STOR (122-LEN(caption))/2 TO adjust STOR $(pad,1,adjust) + caption TO caption RELE pad, adjust, again IF printer = 'Y' @ 23,00 SAY 'Make Printer Ready and hit any key' SET CONSOLE OFF WAIT SET CONSOLE ON SET print ON ENDI IF disk = 'Y' .AND. filename <> ' ' STOR @('.',filename) TO length IF length = 0 .OR. length > 8 STOR 9 TO length ENDI STOR $(filename,1,length-1) TO filename STOR '&dr.:'+filename+'.TXT' TO filename SET ALTERNATE TO &filename SET ALTERNATE ON ENDI ENDI ERAS DO CASE CASE command = 'A' DO title.bk CASE command = 'B' DO special.bk CASE command = 'C' DO wsfile.bk CASE command = 'D' STOR 'T' TO select ERAS @ 03,12 SAY 'Do you want to display alphabetically by uthor or itle ? ' @ 03,76 GET select PICTURE '!' READ DO WHIL @(select,'AT')=0 @ 03,76 GET select PICTURE '!' READ ENDD CLEA GETS IF select = 'A' SET index TO &dr.:&aindex ELSE SET INDEX TO &dr.:&tindex ENDI RELE select @ 05,12 SAY 'You may choose the first letter of' @ 06,12 SAY 'the title of a book as the starting point.' @ 09,12 SAY 'When WAITING hit space bar to' @ 10,12 SAY 'Continue... or ESCape to Quit' STOR 'A' TO letter @ 17,12 SAY 'Letter of alphabet at which to start display' @ 17,57 Get letter PICTURE '!' READ FIND &letter IF #=0 DO WHIL # = 0 STOR RANK(letter) + 1 TO nextl IF nextl <= 91 STOR CHR(nextl) TO next FIND &next STOR next TO letter ELSE GO top ENDI nextl ENDD ENDI * display selected list ERAS SET RAW ON SET ESCAPE OFF DISP NEXT 65000 $(auth1,1,20), $(title,1,25), $(publish,1,20),year IF eof WAIT ENDI SET ESCAPE ON SET RAW OFF SET INDEX TO &dr.:&tindex CASE command = '?' ERAS TEXT R E P O R T M E N U H E L P S C R E E N This program prepares two types of report - a full report on the entire file or one based on variables. Either can be printed and/or sent to a disk file (for editing further using Wordstar or any other word processor). It also produces a file in Wordstar Mailmerge format to allow the user to select the presentation format. The report can be alphabetically by title or by author. The variable report lets you add as many requirements as you wish. (A requirement would be that a specific string be in a given field). Thus, if you want all books dealing with the subject 'cheese' - type 'cheese' (or 'che' or 'eese') in all the subject fields. If the requirement you impose call for a string (including field names) of more than 200 characters the program will give you an error message and ask you to try again. This is a limitation of dBASE which we have to live with. The report menu also allows you to do a screen display by title or author. Because of screen size, we have limited the information in the display. Please hit any key to return to the program ENDT SET CONSOLE OFF WAIT SET CONSOLE ON ERAS CASE (command = 'E' .OR. COMMAND = 'Q') STOR f TO more ENDC SET PRINT OFF SET ALTERNATE OFF ENDD REST from bdata additive SET INDEX TO &dr.:tindex GO TOP RELE ALL STOR t TO more STOR '?' TO command STOR t TO first