! GUIDE_05.SCRIPT - Script #5 title 'GUIDE - PRINT options and HELP' ! Written by Bob van Keuren, Software Design and Consulting ! Date 13 Apr 1989 ! Revised 28 Sep 1989 ! ! This script covers MASK, HEADING, LENGTH, POSITION, and HELP. script 'GUIDE' data 'guide !' do clear area box: 8, 33, 13, 77 print at 9, 35: 'There are many options available in GUIDE' print at 10, 35: 'when you print fields. You will try out' print at 11, 35: 'several of them in this report, using the'; print at 12, 35: 'DETAIL file for an example.' delay print at 9, 35: 'This tutorial also shows how to get help '; print at 10, 35: 'in GUIDE, using the HELP command. '; print at 11, 35: ' '; print at 12, 35: ' '; delay clear area box: 8, 33, 13, 77 print at 9, 35: 'First, enter '; print reverse: "open detail"; print ' to open'; print at 10, 35: 'the DETAIL file.' input at 21, 1, prompt 'Guide> ' allow 'open detail,EXIT', & help 'Enter "open detail"': z$ if z$ = 'EXIT' then data 'exit' exit do end if gosub detail end do stop ! DETAIL report ! detail: data 'open detail' clear area box 8, 33, 13, 77 print at 9, 35: 'Select just a few records in DETAIL' print at 10, 35: 'for this report. Enter '; print reverse: 'include invnbr'; print at 11, 35, reverse: "< 10315"; print ' to get the records that have'; print at 12, 35: 'invoice numbers less than 10315.' input at 21, 1 prompt 'Guide> ', allow "include invnbr < 10315" clear area 8, 77, 13, 77 clear area box 8, 33, 13, 76 print at 9, 35: 'You will sort the DETAIL records by' print at 10, 35: 'invoice number and line. Enter' print at 11, 35, reverse: 'sort by lineid'; print ' to sort on the number.' input at 21, 1 prompt 'Guide> ', allow 'sort by lineid' clear area box 8, 33, 13, 76 print at 9, 35: 'The first field to print is the invoice'; print at 10, 35: 'number. Enter '; print reverse: "print invnbr"; print ' to print'; print at 11, 35: 'this field.'; input at 21, 1 prompt 'Guide> ', allow 'print invnbr' clear area 8, 33, 13, 80 clear area box 6, 33, 11, 77 print at 7, 35: 'The PRINT command has a number of options.'; print at 8, 35: 'You can get information on GUIDE commands'; print at 9, 35: 'with the HELP command. Enter '; print reverse: 'help'; print at 10, 35: 'to get into help.' input at 21, 1, prompt 'Guide> ', allow 'help' clear area box 6, 33, 11, 77 print at 7, 35: 'GUIDE asks you for a help topic.'; print at 8, 35: 'Enter '; print reverse: 'print'; print ' to get information on'; print at 9, 35: 'the PRINT command.'; input at 21, 1, prompt 'Topic: ', allow 'print' clear area box: 6, 32, 10, 78 print at 7, 34: 'Here is the information on the PRINT'; print at 8, 34: 'command, showing the options available.'; delay data '' clear area box: 6, 32, 10, 78 print at 7, 34: 'The help for PRINT also shows related'; print at 8, 34: 'topics where you can get more information'; print at 9, 34: 'later on.'; delay clear area box 6, 32, 10, 78 print at 7, 35: 'Enter '; print reverse: 'exit'; print ' to exit from help.'; input at 21, 1, prompt 'Topic: ', allow 'EXIT' clear area box 8, 33, 14, 76 print at 9, 35: 'You can change a column heading by' print at 10, 35: 'using the HEADING option. Enter '; print at 11, 35, reverse: "print itemnbr heading 'Line'"; print ' to'; print at 12, 35: 'specify a heading. Enter the word'; print at 13, 35: 'within quotes exactly as given.'; input at 21, 1 prompt 'Guide> ', & allow "print itemnbr heading 'Line'" clear area 14, 33, 14, 80 clear area box 8, 33, 13, 78 print at 9, 35: 'When you print the quantity, you can change'; print at 10, 35: 'the size of the column with the LENGTH'; print at 11, 35: 'option. Enter '; print reverse: 'print qty length 6'; print ' to give' print at 12, 35: 'the quantity a width of six characters.'; input at 21, 1 prompt 'Guide> ', allow 'print qty length 6' clear area 8, 77, 13, 80 clear area box 8, 33, 14, 76 print at 9, 35: 'You can print a field in a particular'; print at 10, 35: 'format with the MASK option. A mask'; print at 11, 35: 'is a format for printing a field.'; delay clear area box 8, 33, 14, 76 print at 9, 35: 'To set up a format mask, use a '; print at 10, 35: 'pound sign "#" to indicate characters'; print at 11, 35: 'from the field, and commas and the '; print at 12, 35: 'decimal where you want them.'; delay clear area box 8, 33, 14, 76 print at 9, 35: 'Enter '; print reverse: "print price mask '###,###.##'"; print at 10, 35: 'to indicate the format for the price.'; 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, you can print the extended price' print at 11, 35: 'at a particular location with POSITION.' print at 12, 35: 'Enter '; print reverse: 'print extprice totals position 35'; print '.' print at 13, 35: 'The word "with" is optional.' input at 21, 1, prompt 'Guide> ', allow & 'print extprice with totals position 35,print extprice totals position 35' clear area 14, 33, 14, 80 clear area box 9, 33, 13, 77 print at 10, 35: 'You have set up all the fields.' 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, 12, 77 print at 10, 35: 'You have set up all the fields.' print at 11, 35: 'Enter '; print reverse: 'go'; print ' to produce the report.' input at 21, 1, prompt 'Guide> ', allow 'go' clear area 12, 33, 12, 80 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 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, 16, 76 print at 11, 35: 'In this tutorial you learned about'; print at 12, 35: 'several options for the PRINT command:'; print at 13, 35: 'MASK, HEADING, LENGTH, and POSITION.'; print at 14, 35: 'You also used the HELP command to'; print at 15, 35: 'get information.'; delay clear area 14, 33, 16, 80 clear area box 10, 33, 13, 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