! GUIDE_09.SCRIPT - Script #9: Advanced PRINT options title 'GUIDE - Other PRINT options' ! Written by Bob van Keuren ! Date 5 May 1989 ! Revised 11 Aug 1989 ! ! This script covers CUME, PERCENT, and TOTAL script 'GUIDE' data 'guide !' do clear area box: 8, 32, 14, 78 print at 9, 34: 'The GUIDE PRINT command has many options.'; print at 10, 34: 'You looked at several of them in an earlier'; print at 11, 34: 'tutorial. In this tutorial, you will learn'; print at 12, 34: 'how to use running totals and grand totals,'; print at 13, 34: 'and print percentages.'; delay clear area 8, 77, 14, 78 clear area box: 8, 32, 14, 76 print at 9, 34: 'You will use the CUSTOMER and INVOICE'; print at 10, 34: 'structures. Enter '; print reverse: "open invoice"; print ' to'; print at 11,34: 'open the INVOICE file.'; input at 21,1, prompt 'Guide> ' allow 'open invoice,EXIT', & help 'Enter "open invoice"': z$ select case z$ case 'EXIT' data 'exit' exit do case else data 'open invoice' gosub report case 'open invoice' data 'open invoice' gosub report case 'OPEN INVOICE' data 'open invoice' gosub report end select end do stop ! Report on CUSTOMER and INVOICE ! report: clear area box 8, 32, 13, 76 print at 9, 34: 'Now, open the CUSTOMER structure.'; print at 10, 34: 'Enter '; print reverse: 'open customer'; print '.'; input at 21, 1 prompt 'Guide> ', allow 'open customer' clear area box 8, 32, 13, 76 print at 9,34: 'For each invoice, GUIDE will look up the'; print at 10,34: 'customer. Enter '; print reverse: 'relate invoice(custnbr)'; print at 11,34, reverse: 'to customer(custnbr)' input at 21,1, prompt 'Guide> ', & allow 'relate invoice(custnbr) to customer(custnbr)' clear area box 8, 32, 13, 76 print at 9, 34: 'Now that you have related the files,'; print at 10, 34: 'you can sort the report by customer'; print at 11, 34: 'number. Enter '; print reverse: 'sort by custnbr'; print '.'; input at 21,1 prompt 'Guide> ', allow 'sort by custnbr' clear area box 8, 32, 13, 76 print at 9, 34: 'For each customer, you will print the'; print at 10, 34: 'invoices sorted by invoice number.'; print at 11, 34: 'Enter '; print reverse: 'sort by invnbr'; print '.'; input at 21,1 prompt 'Guide> ', allow 'sort by invnbr' clear area box 8, 32, 13, 76 print at 9,34: 'The report will have a level break on'; print at 10,34: 'customer number. Enter '; print reverse: "break on custnbr"; print '.'; input at 21,1 prompt 'Guide> ', allow 'break on custnbr' clear area box 8, 32, 13, 76 print at 9, 34: 'The report will print the customer number'; print at 10, 34: 'only when it changes. Enter '; print at 11, 34, reverse: 'print custnbr group 1'; print '.'; input at 21,1 prompt 'Guide> ', allow 'print custnbr group 1' clear area box 8, 32, 13, 76 print at 9, 34: 'Next to the number, print the name.'; print at 10, 34: 'Enter '; print reverse: 'print name group 1 heading'; print at 11, 34, reverse: "'Customer Name'"; print '.'; input at 21,1 prompt 'Guide> ', & allow "print name group 1 heading 'Customer Name'" clear area 8, 32, 8, 80 clear area box 9, 32, 14, 76 print at 10,34: 'Print the invoice amount with totals'; print at 11,34: 'and subtotals. Enter '; print reverse: 'print invamt totals'; print '.' input at 21,1, prompt 'Guide> ', & allow 'print invamt totals' clear area 9, 32, 13, 80 clear area box 9, 32, 14, 77 print at 10,34: 'You can also print cumulative or running'; print at 11,34: 'totals with the CUME keyword. Enter '; print reverse: 'print'; print at 12, 34, reverse: "cume invamt heading 'Cumulative,Amount'"; print '.' input at 21,1, prompt 'Guide> ', & allow "print cume invamt heading 'Cumulative,Amount'" clear area 9, 32, 9, 80 clear area box 10, 32, 14, 77 print at 11, 34: 'With PERCENT and TOTAL, you can show'; print at 12, 34: 'what percent each invoice is of the total.'; print at 13, 34: 'Enter '; print reverse: 'print percent invamt of total invamt'; print '.' input at 21, 1, prompt 'Guide> ', & allow 'print percent invamt of total invamt' clear area 9, 77, 13, 77 clear area 14, 32, 14, 80 clear area box 10, 32, 13, 76 print at 11,34: 'Enter a title for the report. Type:'; print at 12,34: reverse: "title 'Invoice Listing'"; input at 21,1, prompt 'Guide> ', allow "title 'Invoice Listing'" clear area box 10, 32, 13, 76 print at 11,34: 'Enter the command '; print reverse: 'show commands'; print at 12, 34: 'to see the commands for the report.' input at 21,1, prompt 'Guide> ', allow "show commands" clear area box 10, 32, 13, 76 print at 11,34: 'The report commands are complete.'; print at 12,34: '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' !if z$ = 'EXIT' then ! data 'exit' ! return !end if !data 'scr' keyboard keyboard keyboard keyboard keyboard keyboard keyboard keyboard keyboard 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: 'This tutorial explained several options'; print at 12, 35: 'you can use with the PRINT statement:'; print at 13, 35: 'CUME, PERCENT, and TOTAL.'; 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