! GUIDE_04.SCRIPT - GUIDE Script #4: Save/Recall title 'GUIDE - SAVE and RECALL' ! Written by Bob van Keuren ! Date 19 Jun 1989 ! Revised 20 Sep 1989 ! ! This script covers SAVE, NEW, and OLD. script 'GUIDE' data 'guide !' do clear area box: 8, 32, 12, 76 print at 9, 34: 'In GUIDE, after you enter commands for'; print at 10, 34: 'a report, you can save those commands'; print at 11, 34: 'and then recall them for use later on.'; delay clear area box: 8, 32, 12, 76 print at 9, 34: 'This GUIDE tutorial shows how to save'; print at 10, 34: 'and recall report formats, and how'; print at 11, 34: 'to start over for a new report.'; delay gosub detail end do stop ! DETAIL report detail: clear area box: 8, 32, 13, 76 print at 9, 34: 'This report will again print a list '; print at 10, 34: 'of detail invoice items, using the' print at 11, 34: 'DETAIL structure. First, enter'; print at 12, 34, reverse: "open detail"; print ' to open the DETAIL file.'; input at 21,1, prompt 'Guide> ' allow 'open detail', & help 'Enter "open detail"' clear area box 8,33,13,77 print at 9,35: 'To indicate which records you want, use' print at 10,35: 'the INCLUDE command. Enter '; print reverse: 'include'; print at 11, 35, reverse: "invnbr < 10320"; print ' to include all invoice' print at 12,35: 'numbers less than 10320.' input at 21,1 prompt 'Guide> ', allow "include invnbr < 10320" clear area box 8,33,13,77 print at 9,35: 'The report will also exclude some of the' print at 10,35: 'records. Enter '; print reverse: "exclude invnbr < 10000"; print at 11, 35: 'to exclude all invoice numbers less'; print at 12, 35: 'than 10000.' input at 21, 1 prompt 'Guide> ', allow "exclude invnbr < 10000" clear area box 8, 33, 13, 77 print at 9, 35: 'Now sort the DETAIL records by invoice'; print at 10, 35: 'number. Enter '; print reverse: 'sort by invnbr'; print ' to sort'; print at 11, 35: 'on the number.' input at 21, 1 prompt 'Guide> ', allow 'sort by invnbr' clear area box 8,33,13,77 print at 9,35: 'After sorting, indicate the fields to'; print at 10,35: 'print. Enter '; print reverse: 'print invnbr,qty'; print ' to print'; print at 11,35: 'the invoice number and quantity.' input at 21,1 prompt 'Guide> ', & allow '"print invnbr,qty", "print invnbr, qty"' clear area box 8,33,13,77 print at 9,35: 'Next, print the selling price.' print at 10,35: 'Enter '; print reverse: 'print price'; print ' to print the price.' input at 21,1, prompt 'Guide> ', allow 'print price' clear area 8, 33, 10, 80 clear area box 9, 33, 15, 77 print at 10,35: 'The final column will be the extended' print at 11,35: 'price, with a total at the end. Enter'; print at 12,35, reverse: 'print extprice with totals'; print '.' print at 14,35: 'The word "with" is optional.' input at 21,1, prompt 'Guide> ', & allow 'print extprice with totals,print extprice totals' clear area 15, 33, 15, 80 clear area box 9, 33, 14, 77 print at 10,35: 'GUIDE prints the report format again.' print at 11,35: 'To see what commands you have entered,'; print at 12,35: 'type '; print reverse: 'show commands'; print '. GUIDE prints a list'; print at 13,35: 'of all the commands for this report.' input at 21,1, prompt 'Guide> ', allow 'show commands' clear area 9, 33, 12, 35 clear area box 8, 36, 13, 77 print at 9, 38: 'You can save the commands you entered'; print at 10, 38: 'for use later on. Enter '; print reverse: 'save detail'; print at 11, 38: 'to save the Guide commands.' input at 21,1, prompt 'Guide> ', allow 'save detail' clear area box 8, 36, 13, 77 print at 9, 38: 'GUIDE saves the commands in the file'; print at 10, 38: 'DETAIL.GUIDE.' delay clear area box 8, 36, 14, 77 print at 9,38: 'At this point, you can start on a'; print at 10,38: 'different report, if you wish. The'; print at 11, 38: 'NEW command tells GUIDE to erase all'; print at 12, 38: 'commands from memory so you can start'; print at 13, 38: 'on a new report. Enter '; print reverse: 'NEW'; print '.'; input at 21,1, prompt 'Guide> ', allow 'NEW' clear area box 9, 33, 14, 77 print at 10, 35: 'GUIDE clears memory, just as if you had'; print at 11, 35: 'not entered any commands.'; print at 12, 35: 'Type '; print reverse: 'show commands'; print ', and GUIDE prints'; print at 13, 35: 'a blank list.'; input at 21, 1, prompt 'Guide> ', allow 'show commands' clear area 9, 77, 14, 77 clear area box 9, 33, 14, 77 print at 10, 35: 'Later on, instead of typing all the'; print at 11, 35: 'commands by hand, you can recall the '; print at 12, 35: 'ones you entered previously with the'; print at 13, 35: 'SAVE command.'; delay clear area box 9, 33, 14, 77 print at 10, 35: 'You saved the commands in the file'; print at 11, 35: 'DETAIL.GUIDE. Enter '; print reverse: 'OLD DETAIL'; print at 12, 35: 'to recall them.'; input at 21,1, prompt 'Guide> ', allow 'old detail' clear area 14, 33, 14, 80 clear area box 9, 33, 13, 76 print at 10,35: 'Now you can look at the commands entered'; print at 11,35: 'previously. Type '; print reverse: 'show commands'; print '.'; input at 21,1, prompt 'Guide> ', allow 'show commands' clear area box 9, 33, 13, 76 print at 10, 35: 'You can add more commands to the ones'; print at 11, 35: 'previously entered. For example, type '; print at 12, 35, reverse: 'print custnbr'; print ' to add the customer number.'; input at 21,1, prompt 'Guide> ', allow 'print custnbr' clear area box 9, 33, 13, 76 print at 10,35: 'Now when you type '; print reverse: 'show commands'; print ','; print at 11,35: 'GUIDE displays the new command along'; print at 12,35: 'with the previous ones.'; print '.'; input at 21,1, prompt 'Guide> ', allow 'show commands' clear area box 9, 33, 13, 76 print at 10,35: 'Now produce the report.'; print at 11,35: 'Enter '; print reverse: 'go'; print '.'; 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 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 9, 33, 12, 76 print at 10,35: 'GUIDE prints the report format again.' delay clear area box 9, 33, 15, 77 print at 10, 35: 'In this exercise, you have learned how to'; print at 11, 35: 'SAVE commands, clear memory to start a NEW'; print at 12, 35: 'report, recall previously saved commands'; print at 13, 35: 'with OLD, and add to them. Now type '; print reverse: 'exit'; print at 14, 35: 'to exit from GUIDE.' input at 21,1, prompt 'Guide> ', allow 'EXIT' return end script