! GUIDE_6.SCRIPT - Script #6: GROUP, BREAK, OUTPUT, TITLE title 'GUIDE - Level breaks' ! Written by Bob van Keuren ! Date 19 Apr 1989 ! Revised 11 Aug 1989 ! ! This script covers GROUP, BREAK, OUTPUT, and TITLE script 'GUIDE' data 'guide !' do clear area box: 7, 32, 13, 76 print at 8, 34: 'When you print a report, you may want to' print at 9, 34: 'group the records, with a visual break' print at 10, 34: 'so that the groups stand out, and a'; print at 11, 34: 'subtotal for each group. You can do' print at 12, 34: 'this with the BREAK and GROUP statements.' delay clear area box: 7, 32, 13, 76 print at 8, 34: 'The tutorial also shows how to change' print at 9, 34: 'page headings and how to print reports' print at 10, 34: 'to a named output listing file.'; delay clear area box: 7, 32, 13, 76 print at 8, 34: 'The tutorial illustrates grouping'; print at 9, 34: 'by printing a list of DETAIL records,'; print at 10, 34: 'grouping them by invoice number,'; print at 11, 34: 'with a subtotal for each invoice.'; delay clear area 11, 32, 13, 76 clear area box: 7, 32, 10, 76 print at 8, 34: 'Enter '; print reverse: "open detail"; print ' to open the DETAIL'; print at 9, 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 end select data 'open detail' gosub detail end do stop ! DETAIL report with level breaks ! detail: clear area box 8, 33, 13, 77 print at 9, 35: 'Select a group of the records in the' print at 10, 35: 'DETAIL structure. Enter '; print at 11, 35: reverse: "include invnbr < 10315"; print '.'; input at 21, 1 prompt 'Guide> ', allow "include invnbr < 10315" clear area 8, 76, 13, 77 clear area box 8, 33, 13, 76 print at 9, 35: 'Sort the DETAIL records by invoice' print at 10, 35: 'number and line. Enter '; print reverse: 'sort by lineid'; print at 11, 35: 'to sort on the number.' input at 21, 1 prompt 'Guide> ', allow 'sort by lineid' clear area 8, 76, 13, 80 clear area box 8, 33, 13, 76 print at 9, 35: 'You can specify where you want subtotals' print at 10, 35: 'with the BREAK command. Enter' print at 11, 35, reverse: 'break on invnbr'; print ' to do a level break'; print at 12, 35: 'on the number.' input at 21, 1 prompt 'Guide> ', allow 'break on invnbr' clear area box 8, 33, 13, 76 print at 9, 35: 'You can print the invoice number only'; print at 10, 35: 'when it changes by using the GROUP'; print at 11, 35: 'option. Enter '; print reverse: "print invnbr group 1"; print '.'; input at 21, 1 prompt 'Guide> ', allow 'print invnbr group 1' clear area 13, 33, 13, 76 clear area box 8, 33, 12, 76 print at 9, 35: 'Enter '; print reverse: 'print itemnbr,qty'; print ' to print the'; print at 10, 35: 'line item and quantity.'; input at 21, 1 prompt 'Guide> ', & allow '"print itemnbr,qty"' clear area 14, 33, 14, 77 clear area box 8, 33, 13, 76 print at 9, 35: 'Format the selling price with the'; print at 10, 35: 'MASK option. Enter'; print at 11, 35, reverse: "print price mask '###,###.##'"; print at 12, 35: 'to print the price in this format.' input at 21, 1, prompt 'Guide> ', allow "print price mask '###,###.##'" 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 box 9, 33, 14, 76 print at 10, 35: 'When GUIDE produces a report, it prints'; print at 11, 35: 'the report to a file. You can specify'; print at 12, 35: 'the name of the output listing file'; print at 13, 35: 'with the OUTPUT command.'; delay clear area box 9, 33, 14, 76 print at 10, 35: 'Enter '; print reverse: 'output invoice_report'; print ' to print the'; print at 11, 35: 'report to the file INVOICE_REPORT.LIS.' input at 21, 1, prompt 'Guide> ', allow 'output invoice_report' clear area box 9, 33, 15, 76 print at 10, 35: 'At the top of each page, you can print'; print at 11, 35: 'page headings, with the TITLE command.'; print at 12, 35: 'Enter '; print reverse: "title 'Invoice Listing'"; print ' to set up'; print at 13, 35: 'this heading line. Be sure to type the'; print at 14, 35: 'text within quotes exactly as given.'; input at 21, 1, prompt 'Guide> ', allow "title 'Invoice Listing'" clear area 14, 33, 15, 80 clear area box 9, 33, 13, 77 print at 10, 35: 'You have set up all the columns.' print at 11, 35: 'To see the commands you have entered,'; print at 12, 35: 'type '; print reverse: 'show commands'; print '.'; input at 21, 1, prompt 'Guide> ', allow 'show commands' clear area box 9, 33, 13, 77 print at 10, 35: 'Now that the report is ready, enter'; print at 11, 35, 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,exit' 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 reverse: 'exit' print at 10, 35: 'to 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, 15, 76 print at 11, 35: 'This tutorial has explained the commands'; print at 12, 35: 'BREAK, GROUP, TITLE, and OUTPUT.'; print at 13, 35: 'Now enter the command '; print reverse: 'exit' print ' to exit'; print at 14, 35: 'from GUIDE.' input at 21, 1, prompt 'Guide> ', allow 'EXIT' return end script