! GUIDE_01.SCRIPT - Introduction to GUIDE ! Written by Bob van Keuren ! Date 23 Jan 1989 ! Revised 30 Oct 1989 title 'GUIDE - Introduction to Guided Query Language' script 'GUIDE' data 'guide' do clear area box: 6, 18, 12, 62 print at 7, 20: 'Welcome to the Guided Query Language!'; print at 8, 20: 'This is the first in a series of'; print at 9, 20: 'tutorials to help you learn how to'; print at 10, 20: 'use GUIDE to print reports on your'; print at 11, 20: 'terminal screen or on paper.' delay clear area box: 6, 18, 12, 62 print at 7, 20: 'This first tutorial will show you how'; print at 8, 20: 'you can produce reports very quickly'; print at 9, 20: 'with GUIDE. Press '; print reverse: 'Return'; print ' to continue'; print at 10, 20: 'with the tutorial, or enter '; print reverse: 'exit'; print at 11, 20: 'to exit from GUIDE.'; input at 21,1, prompt 'Option? ' allow ',EXIT', & help 'Enter "exit" or press Return': z$ if z$ = 'EXIT' then data 'exit' exit do end if clear area 6, 18, 12, 80 clear area box: 6, 18, 12, 62 print at 7, 20: 'GUIDE can produce reports for you.' print at 8, 20: 'Suppose you want to print a report'; print at 9, 20: 'on the products your company produces.'; print at 10, 20: 'In this tutorial, you will enter the'; print at 11, 20: 'commands to produce a product list.'; delay clear area box: 6, 18, 12, 62 print at 7, 20: 'On the computer, information on a given'; print at 8, 20: 'subject is stored in something called a '; print at 9, 20: 'DATA STRUCTURE. A data structure is '; print at 10, 20: 'like a table of information.'; delay clear area box: 3, 18, 9, 62 clear area 10, 1, 21, 80 print at 4, 20: 'A CUSTOMER data structure contains '; print at 5, 20: 'information on customers. A PRODUCT '; print at 6, 20: 'data structure contains information on '; print at 7, 20: 'products, such as product number, '; print at 8, 20: 'description, and price. For example:'; print at 11, 37: 'fields'; print at 12, 17: ' Product Selling'; print at 13, 17: ' Number Description Cost Price'; print at 14, 17: '+------+-----------------------+-------+------+'; print at 15, 17: '|20120 |Bananna PC Jr | 1,200| 1,600|'; print at 16, 17: '|22600 |EZVue-600 CRT terminal | 225| 300|'; print at 17, 17: '|22800 |EZVue-800 CRT terminal | 260| 350|'; print at 18, 17: '|24100 |ZX-100 printer | 150| 180|'; print at 19, 17: '|24200 |ZX-LQ printer | 200| 250|'; print at 20, 17: '+------+-----------------------+-------+------+'; delay clear area 3, 1, 21, 80 clear area box: 6, 34, 12, 76 print at 7, 36: 'First, you need to tell GUIDE what'; print at 8, 36: 'data structure you are going to use.'; print at 9, 36: 'The OPEN command tells GUIDE to open'; print at 10, 36: 'a data structure for the report.'; delay clear area box: 6, 34, 12, 76 print at 7, 36: 'This report will use the PRODUCT'; print at 8, 36: 'structure. Enter '; print reverse: "open product"; print at 9, 36: 'to open this structure.' input at 21,1, prompt 'Guide> ' allow 'open product,EXIT', & help 'Enter "open product"': z$ select case z$ case 'EXIT' data 'exit' exit do case 'open product' gosub product case 'OPEN PRODUCT' gosub product end select end do stop ! PRODUCT report ! product: data 'open product' clear area 6, 34, 6, 80 clear area box: 7, 34, 13, 76 print at 8,36: 'The PRINT command tells GUIDE which'; print at 9,36: 'fields to print. In the product'; print at 10, 36: 'structure, the product number field'; print at 11, 36: 'is called PRODNBR. Enter '; print reverse: 'print prodnbr'; print at 12, 36: 'to print the product number.' input at 21,1 prompt 'Guide> ', allow 'print prodnbr' clear area 13, 34, 13, 80 clear area box: 7,34,12,76 print at 8, 36: 'GUIDE displays a mock-up of the report.'; print at 9, 36: 'As you enter fields to print, GUIDE'; print at 10, 36: 'shows where each column will appear'; print at 11, 36: 'on the report.'; delay clear area box: 7,34,12,76 print at 8,36: 'If you do not remember the field names,' print at 9, 36: 'GUIDE can list them for you. Enter' print at 10, 36: 'the command '; print reverse: 'show fields'; print ' to produce'; print at 11, 36: 'the list.' input at 21,1 prompt 'Guide> ', allow 'show fields' ! clear area box: 7,34,12,76 print at 8,36: 'You can print two fields at once ' print at 9,36: 'by putting a comma between them. ' print at 10,36: 'Enter '; print reverse: 'print desc,cost' print at 10,57: ' to print the ' print at 11,36: 'description and cost. ' input at 21,1 prompt 'Guide> ', allow '"print desc,cost", "print desc, cost"' clear area box: 7,34,12,76 print at 8,36: 'Once you have set up all the fields,' print at 9,36: 'enter ' print at 9,42, reverse: 'go' print at 9,45: 'to produce the report.' input at 21,1, prompt 'Guide> ', allow 'go' clear area 18, 1, 21, 80 clear area box: 7,34,12,76 print at 8,36: 'GUIDE produces the report and asks'; print at 9,36: 'where to print it. Enter '; print at 9,62, reverse: 'scr'; print at 9,66: 'to'; print at 10,36: 'print the report at your terminal.'; print at 11,36: '(You may also use the arrow keys.)'; 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' ! For the 'Press Return' question keyboard clear area 18, 1, 21, 80 clear area box: 7,34,11,76 print at 8,36: 'After printing, GUIDE returns to the'; print at 9,36: 'print option menu. Enter'; print at 9,62, reverse: 'exit'; print ' to'; print at 10,36: '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: 7,34,13,76 print at 8, 36: 'GUIDE displays the report format again.'; print at 9, 36: 'You have now produced your first report'; print at 10, 36: 'with the commands OPEN, PRINT, SHOW '; print at 11,36: 'FIELDS, and GO.'; delay clear area box: 7,34,13,76 print at 8, 36: 'You have completed the first tutorial'; print at 9, 36: 'on the Guided Query Language.'; print at 11,36: 'Enter '; print reverse: 'exit'; print ' to exit from GUIDE.'; input at 21,1, prompt 'Guide> ', allow 'EXIT' return end script