! GUIDE_8.SCRIPT - Script #8: Summary report title 'GUIDE - Summary report' ! Written by Bob van Keuren ! Date 20 Apr 1989 ! Revised 11 Aug 1989 ! ! This script covers SUMMARY script 'GUIDE' data 'guide !' do clear area box: 8, 32, 14, 76 print at 9, 34: 'With GUIDE, it is possible to do both'; print at 10, 34: 'detail and summary reports. In this'; print at 11, 34: 'script, you will take a previous detail'; print at 12, 34: 'report and make a summary report from it.'; delay clear area box: 8, 32, 14, 76 print at 9, 34: 'You will print an invoice summary,' print at 10, 34: 'using the DETAIL and INVOICE structures.' print at 11, 34: 'Enter '; print reverse: "open detail"; print ' to open the DETAIL'; print at 12,34: 'file.' input at 21,1, prompt 'Guide> ' allow 'open detail,EXIT', & help 'Enter "open detail"': z$ select case z$ case 'EXIT' data 'exit' exit do case 'open detail' data 'open detail' gosub summary case 'OPEN DETAIL' data 'open detail' gosub summary end select end do stop ! Summary report on INVOICE and DETAIL ! summary: clear area box 8, 32, 13, 76 print at 9, 34: 'Now, open the INVOICE structure.'; print at 10, 34: 'Enter '; print reverse: 'open invoice'; print ' to name the second'; print at 11, 34: 'structure.'; input at 21, 1 prompt 'Guide> ', allow 'open invoice' clear area box 8, 32, 14, 76 print at 9,34: 'Tell GUIDE to look up the invoice with' print at 10,34: 'a RELATE statement. Enter '; print at 11,34: reverse: 'relate detail(invnbr) to invoice(invnbr)'; print '.'; input at 21,1, prompt 'Guide> ', & allow 'relate detail(invnbr) to invoice(invnbr)' clear area 14,32,14,80 clear area box 8, 32, 13, 76 print at 9,34: 'Select a group of the records in' print at 10,34: 'DETAIL. Enter '; print reverse: "include invnbr < 10315"; print '.'; input at 21,1 prompt 'Guide> ', allow "include invnbr < 10315" clear area 8,32,13,32 clear area box 8, 33, 13, 76 print at 9,35: 'This report will again do a level break'; print at 10,35: 'on invoice number. Enter '; print reverse: 'break on invnbr'; print at 11, 35: 'for this level break.' input at 21,1 prompt 'Guide> ', allow 'break on invnbr' clear area box 8,33,13,76 print at 9,35: 'Print the invoice number only when' print at 10,35: 'it changes. Enter '; print reverse: "print invnbr group 1"; print '.'; input at 21,1 prompt 'Guide> ', allow 'print invnbr group 1' clear area box 8,33,13,76 print at 9,35: 'Print the invoice date, also, from' print at 10,35: 'the field in the INVOICE structure.'; print at 11, 35: 'Enter '; print reverse: 'print invoice(date) group 1'; print '.'; input at 21,1 prompt 'Guide> ', allow 'print invoice(date) group 1' clear area 8,33,10,80 clear area box 9,33,14,76 print at 10,35: 'Finally, print the extended price with' print at 11,35: 'totals and subtotals. Enter'; print at 12,35, reverse: 'print extprice totals'; print '.' input at 21,1, prompt 'Guide> ', & allow 'print extprice with totals,print extprice totals' clear area 8,32,14,80 clear area box 9, 33, 13, 76 print at 10,35: 'GUIDE should print information for' print at 11,35: 'the invoices only at level break time,' print at 12,35: 'so enter the command '; print reverse: 'summary'; print '.'; input at 21,1, prompt 'Guide> ', allow 'summary' clear area 8,32,13,80 clear area box 9,33,12,76 print at 10,35: 'Enter a title for the page headings.'; print at 11, 35: 'Type '; print reverse: "title 'Invoice Summary Listing'"; print '.'; input at 21,1, prompt 'Guide> ', allow "title 'Invoice Summary Listing'" clear area box 9, 33, 12, 76 print at 10, 35: 'Type '; print reverse 'show commands'; print ' to see the commands'; print at 11, 35: 'for this report.'; input at 21,1, prompt 'Guide> ', allow 'show commands' clear area box 9, 33, 12, 76 print at 10,35: 'You are ready for the report.'; print at 11,35: 'Enter '; print reverse: 'go'; print ' to produce the report.' input at 21,1, prompt 'Guide> ', allow 'go,EXIT': z$ select case z$ case 'EXIT' data 'exit' return case 'go' data 'go' case 'GO' data 'go' end select clear area 18, 1, 21, 80 clear area box 7,33,11,76 print at 8,35: 'GUIDE asks where to print the report.' print at 9,35: 'Enter '; print reverse: 'scr'; print ' to print the report at the' print at 10,35: 'terminal.' input menu '%title " Output Options ", %at 18, 8, %items 2, "Screen"=SCR, "Printer Port"=pri, "System Printer"=sys, "Save to Disk"=sav, exit', allow 'scr' keyboard keyboard clear area 18, 1, 21, 80 clear area box 7,33,11,76 print at 8,35: 'After printing, GUIDE returns to the' print at 9,35: 'print option menu. Enter' print at 9,61, reverse: 'exit'; print ' to'; print at 10,35: 'return to GUIDE.' input menu '%title " Output Options ", %at 18, 8, %items 2, "Screen"=SCR, "Printer Port"=pri, "System Printer"=sys, "Save to Disk"=sav, exit', allow 'exit' clear area box 10,33,14,76 print at 11,35: 'In this session, you used the command'; print at 12, 35: 'SUMMARY to make a summary report'; print at 13, 35: 'that prints only at level breaks.'; delay clear area box 10,33,14,76 print at 11,35: 'Now enter the command '; print reverse: 'exit' print ' to exit'; print at 12,35: 'from GUIDE.' input at 21,1, prompt 'Guide> ', allow 'EXIT' return end script