home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / prntsay.zip / PRINTSAY.DOC < prev    next >
Text File  |  1988-01-01  |  46KB  |  857 lines

  1.  
  2.                            - PRINT-SAY* MANUAL - 
  3.  
  4.                            - TABLE OF CONTENTS - 
  5.  
  6.      PART ONE - (PRINTSAY.DOC): 
  7.  
  8.      SECTION 1: Introduction 
  9.        1.1: Purpose 
  10.        1.2: What It Does 
  11.        1.3: Who Should Use It? 
  12.        1.4: Advantages 
  13.        1.5: Disadvantages 
  14.  
  15.      SECTION 2: General Instructions 
  16.        2.1: Installation 
  17.        2.2: How To Use 
  18.        2.3: How To Proceed 
  19.  
  20.      SECTION 3:  A Crib Sheet 
  21.        3.1: Initial Questions Section 
  22.          3.1.1: Logo Heading 
  23.          3.1.2: Your Name 
  24.          3.1.3: Absolute Or Relative Row-Addressing: 
  25.          3.1.4: Allow Compressed Pitch 
  26.          3.1.5: Width Of Paper 
  27.          3.1.6: Length Of Paper 
  28.          3.1.7: Separators 
  29.          3.1.8: Bar Character 
  30.          3.1.9: Out-Put File Name 
  31.          3.1.10: Report Title 
  32.          3.1.11: Database 
  33.          3.1.12: Indexes 
  34.          3.1.13: Conditional If Statement 
  35.          3.1.14: Number Of Fields 
  36.        3.2: Field Questions 
  37.          3.2.1: Field Title 
  38.          3.2.2: Field Contents 
  39.          3.2.3: Is Field Numeric? 
  40.          3.2.4: Field Size 
  41.          3.2.5: Number Of Decimals 
  42.          3.2.6: Sub-Totals 
  43.        3.3: PRINTSAY.DAY and Re-Usables 
  44.  
  45.      SECTION 4: Taking a Guided Tour: 
  46.        4.1: Getting Started 
  47.        4.2: The Re-Usables Questions 
  48.        4.3: Throw-Aways 
  49.        4.4: Revisions 
  50.        4.5: Field Questions 
  51.        4.6: Repeating the Process 
  52.        4.7: Handling Numeric Fields 
  53.        4.8: Field-By-Field Revision 
  54.        4.9: Running the Report 
  55.        4.10: Where To Go From Here 
  56.  
  57.  
  58.      PART TWO - (CUSTMIZE.DOC): 
  59.  
  60.      SECTION 5: Exploring a PRINT-SAY .PRG File 
  61.        5.1: First Thoughts 
  62.        5.2: How To Proceed 
  63.        5.3: Step-By-Step 
  64.          5.3.1: Step One 
  65.          5.3.2: Step Two 
  66.          5.3.3: The Title Block 
  67.          5.3.4: Initialize Environment 
  68.          5.3.5: Initialize Variables 
  69.          5.3.6: Creating the Screen Display 
  70.          5.3.7: Setting Up For Printing 
  71.          5.3.8: Control Structures 
  72.          5.3.9: Printing the Header Lines 
  73.          5.3.10: Printing the Field Titles 
  74.          5.3.11: Drawing the Underline 
  75.          5.3.12: The Work-Horse Loop 
  76.          5.3.13: Accumulating the Sub-Totals 
  77.          5.3.14: Displaying the Sub-Totals 
  78.          5.3.15: Restoring the Environment 
  79.  
  80.        SECTION 6: Making Changes 
  81.          6.1: The Header Block 
  82.          6.2: Initialize Environment Block 
  83.          6.3: Initialize Variables Block 
  84.          6.4: Create Screen Display Block 
  85.          6.5: Set-up For Printing Block 
  86.          6.6: Page Header Block 
  87.            6.6.1: Using Expanded Print 
  88.            6.6.2: Adding An Additional Logo Line 
  89.            6.6.3: Other Changes 
  90.          6.7: Column Titles Block 
  91.            6.7.1: Re-Locating Individual Titles 
  92.            6.7.2: Adding an Additional Title Line 
  93.          6.8: Printing Records Block 
  94.          6.9: Closing Off 
  95.  
  96.        SECTION 7: Index 
  97.  
  98.  
  99.                          - BEFORE WE GET STARTED - 
  100.  
  101.  
  102.     i. A note on the typographic conventions used in this manual: 
  103.  
  104.      - dBASE and DOS commands and command words are shown in capitals. 
  105.                           E.g.: RUN PRINTSAY. 
  106.  
  107.      - Commands you should enter as shown are separated from the text 
  108.        of the manual with extra spaces. 
  109.            E.g.: now type  RUN PRINTSAY  at the dot prompt. 
  110.  
  111.      - When a command requires you to enter a specific referent, 
  112.                       E.g.:  LIST <FileName> 
  113.        the unknown is shown in angle brackets, and you are expected 
  114.        to enter an actual file name from your own work. 
  115.  
  116.      - Keys on the keyboard are enclosed in square brackets: [PgUp]; 
  117.        and when one key needs to be held down while another is touched 
  118.        they are shown thusly: [Shift-E] - which would create a capital E. 
  119.        Note: The key with an arrow bent to the left, which is used to 
  120.        inform the computer when you are ready to have it read what you've 
  121.        typed is sometimes labeled Return and sometimes Enter.  In this 
  122.        manual it is referred to as: [Enter]. 
  123.  
  124.      - Phrases which are quoted from PRINT-SAY itself or one of its 
  125.        reports are presented in single quotes. 
  126.  
  127.      - Phrases which are presented as possible user responses to PRINT- 
  128.        SAY are shown in double quotes. 
  129.  
  130.  
  131.     ii. Files you should find on your distribution diskette or .arc file: 
  132.  
  133.           1. PRINTSAY.COM  - the actual program 
  134.           2. PRINTSAY.DOC  - this manual 
  135.           3. CUSTMIZE.DOC  - its sister 
  136.           4. CLIQUE.DBF    - a fictitious dBASE database used in examples 
  137.           5. CLIQNAME.NDX  - the index for the above 
  138.           6. REPORT.PRG    - sample output file (used in examples) 
  139.           7. ORDER         - order form and catalog
  140.  
  141.     iii. The names dBASE, dBASE III, and dBASE III Plus are registered 
  142.          trademarks of Ashton-Tate. 
  143.  
  144.  
  145.                                  SECTION 1 
  146.                              - Introduction - 
  147.  
  148.      1.1. PURPOSE: 
  149.        As with the dBASE LIST TO PRINT command, the purpose of PRINT-SAY 
  150.      is to allow you to list fields from a database in order to create a 
  151.      basic report. 
  152.        PRINT-SAY is intended to fill a gap not met by either dBASE's 
  153.      LIST command or its REPORT FORM command by providing a LIST which 
  154.      uses the printer's resources adequately enough to make a presentable 
  155.      report.  This, in itself, makes it a useful tool for the normal bus- 
  156.      iness user.  PRINT-SAY especially shines, however, for the programmer, 
  157.      since PRINT-SAY generates dBASE code which is available as a good, 
  158.      labour-saving, starting point for more elaborate printer reports, to 
  159.      include in larger programs. 
  160.        PRINT-SAY works with dot-matrix printers: Epsons and true compat- 
  161.      ibles.  Sorry: some inexpensive printers will not perform the chores 
  162.      PRINT-SAY demands. 
  163.  
  164.      1.2. WHAT IT DOES: 
  165.        PRINT-SAY starts by asking you a series of questions; from your 
  166.      answers it then performs a multitude of calculations; finally it 
  167.      creates a file containing dBASE program code.  This code IN TURN 
  168.      generates a report on the contents of a database.  In other words:
  169.      PRINT-SAY is a program which writes a program (such programs are 
  170.      called code-generators; APPSGEN provided with dBASE III Plus is an- 
  171.      other dBASE code-generator). 
  172.        The result is a report, which you may use and re-use, which lists 
  173.      only those fields you specify, only those records which match the 
  174.      conditions you provide, and with a bolded and centered header and 
  175.      field titles of your choice. 
  176.  
  177.      1.3. WHO SHOULD USE IT? 
  178.        dBASE users fall into three categories: ASSISTants, dot-prompters, 
  179.      and programmers.  To make comfortable use of PRINT-SAY you should 
  180.      be moderately proficient with dot-prompt command entry.  If you can 
  181.      work with USE <dbf>, LIST <fields>, DISPLAY ALL, etc., then you can 
  182.      also use the commands RUN PRINT-SAY and DO <prg>, which are all that 
  183.      are necessary to use PRINT-SAY. 
  184.        PRINT-SAY has been optimised to the needs of light-weight dot- 
  185.      prompters and to heavy-weight programmers, since, strangely, their 
  186.      needs are the much the same.  PRINT-SAY performs all the functions 
  187.      a non-programmer is likely to ask of it.  Since it generates dBASE 
  188.      code, the advanced user will know how to add lines and change lines 
  189.      to create exactly the report he needs. 
  190.        Further, PRINTSAY.DOC is provided to use PRINT-SAY's .PRG output 
  191.      as a very effective means to teaching a non-programmer the rudiments 
  192.      of dBASE programming.  By working with PRINT-SAY, the non-programmer 
  193.      can also learn how to customize PRINT-SAY programs. 
  194.  
  195.      1.4. ADVANTAGES: 
  196.        The biggest advantage of PRINT-SAYing over REPORTing is that it 
  197.      automatically takes advantage of the three standard print pitches - 
  198.      pica, elite, and compressed - to allow you to put more fields of 
  199.      information on the same width of paper.  REPORT only works with the 
  200.      widest pitch, pica. 
  201.        Because REPORT does not generate dBASE .PRG code, you cannot mod- 
  202.      ify its output to take advantage of more advanced printer features 
  203.      like elite, compressed, emphasized, and bolding.  PRINT-SAY's output 
  204.      is in dBASE code and is therefore available for your modifications 
  205.      and improvements. 
  206.        The use of modified and unmodified PRINT-SAY reports has another 
  207.      advantage in a business environment of providing a consistency of 
  208.      report formats.  Not only does this make for an appearance of pro- 
  209.      fessionalism: it provides an instant message to the eye: this is an 
  210.      in-house report. 
  211.        Furthermore, unlike list, PRINT-SAY provides you the option of 
  212.      reporting sub-totals at the bottom of each page. 
  213.        The biggest advantage of all is PRINT-SAY's enormous labour-saving 
  214.      and time-saving potential in the hands of a dBASE programmer.  A 
  215.      programmer should never have to waste his time with tedious or re- 
  216.      petitive routines, and creating printer reports contains some of the 
  217.      most tedious and repetitive there are! 
  218.  
  219.      1.5. DISADVANTAGES: 
  220.        The disadvantage of PRINT-SAY over REPORT is that PRINT-SAY cannot
  221.      handle memo fields!  (The solution?  Don't use memo fields!  Memos 
  222.      are messy to handle and can usually be replaced by a full-screen 
  223.      field or two, in any case.  Full-screen fields offer the advantage 
  224.      of being accessible to normal data-entry routines, as well as being 
  225.      normally reportable.) 
  226.        PRINT-SAY also does not generate totals-summaries.  But this is 
  227.      trivial given that the simple dBASE command TOTAL ON <Key-Field> gen- 
  228.      erates a totals database which PRINT-SAY can then report on.  When 
  229.      combined with the sub-totals option in PRINT-SAY, you will find that 
  230.      most of your reporting needs are covered without customization. 
  231.  
  232.  
  233.  
  234.  
  235.                                  SECTION 2 
  236.                           - General Instructions - 
  237.  
  238.  
  239.      2.1. INSTALLATION: 
  240.        Hard-disk users should copy PRINTSAY.COM to the sub-directory con- 
  241.      taining DBASE.EXE and DBASE.OVL, etc. or any special utility sub-dir- 
  242.      ectory.  Floppy users should copy it to the second dBASE system disk,  
  243.      if room exists, or to their data disk, otherwise. 
  244.  
  245.      2.2. HOW TO USE: 
  246.        (If you are a dBASE ASSIST user, first press the [Esc] key to exit 
  247.      ASSIST.) 
  248.        You will need a list of the fields in your database, including 
  249.      their sizes.  Type  USE <Database>  then  LIST STRU TO PRINT  with 
  250.      your printer on.  (If you are familiar with SideKick (tm), you can 
  251.      capture a LIST STRU to its note-pad.) 
  252.        To use PRINT-SAY simply type  RUN PRINTSAY  from the dBASE dot- 
  253.      prompt and answer each question as it asks them.  Once you have an- 
  254.      swered all its questions PRINT-SAY will automatically write a dBASE 
  255.      .PRG file to your diskette or current hard-disk sub-directory. 
  256.        To use this file enter  DO <FileName>  at the dBASE dot-prompt - 
  257.      where <filename> is the name you gave for the .PRG file in Question 
  258.      8 (see below). 
  259.        For example, (if I may jump ahead for a second) if you answered  
  260.      Question 8 with "PAYREPRT.PRG", then enter  DO <PayReprt>  at the 
  261.      dot-prompt. 
  262.  
  263.  
  264.        To summarize these steps: 
  265.  
  266.              1. USE <database> ;  LIST STRU TO PRINT. 
  267.              2. In BASE  RUN PRINTSAY  (- in DOS simply  PRINTSAY ) 
  268.              3. Answer all questions 
  269.              4. Revise answers if necessary 
  270.              5. If in DOS enter dBASE 
  271.              6. At dot-prompt type  DO <filename> , 
  272.               - where <filename> is your answer to Question 8. 
  273.  
  274.  
  275.       2.3 HOW TO PROCEED: 
  276.         At this stage you could take any of three paths to learn your 
  277.       way through PRINT-SAY.  One, if you're even a moderately experi- 
  278.       enced user, you may want to simply plunge in, trying it out for 
  279.       yourself, knowing that there's no harm you can do and that you 
  280.       can back-out at any time with a simple [Ctrl-C]. 
  281.         Secondly, you could try it out - perhaps creating a fictitious 
  282.       report - by reading along with the following Crib Sheet Section, 
  283.       and bearing in mind that any question you don't understand the 
  284.       import of can most likely be answered by simply pressing the 
  285.       [Enter] key to accept the default value. 
  286.         Finally, you could skip past the Crib Sheet Section and take 
  287.       the Guided Tour. 
  288.         After a fair amount of normal use of PRINT-SAY, you may finally 
  289.       want to proceed to Section 5 to learn how to tailor the dBASE 
  290.       code PRINT-SAY generates to create specialized reports or to 
  291.       modify the appearance of its reports to suit your personal pre- 
  292.       ference. 
  293.  
  294.  
  295.                                  SECTION 3 
  296.                               - A Crib Sheet - 
  297.  
  298.  
  299.  
  300.        The following information should answer your questions about each 
  301.      of the questions PRINT-SAY asks.  Section 3 is the basic reference 
  302.      material of this manual, which you may want to print it for daily 
  303.      reference.  You may also want to skip it upon first reading and pro- 
  304.      ceed to Section 4: A Guided Tour. 
  305.  
  306.      3.1. INITIAL QUESTIONS SECTION: 
  307.        The distinction between Re-usables and Throw-aways will be ex- 
  308.      plained in 3.3. If you haven't experimented with PRINT-SAY yet it 
  309.      will ask the Re-usables first then go on to the Throw-aways.  If you 
  310.      have used it, it will report your previous answers and go on to the 
  311.      Throw-aways. 
  312.  
  313.                                 - RE-USABLES - 
  314.  
  315.        3.1.1. LOGO HEADING: 
  316.          Each page of print-out will have a banner in bolded type-face. 
  317.        Besides reporting the page number and date, it will have a title 
  318.        for the particular report you are creating, and at the very top it 
  319.        will have an over-all title, which would usually be the name of 
  320.        the company or division which owns the report.  You may enter up 
  321.        to seventy characters for this heading; when you reach the right- 
  322.        hand edge of the entry box the cursor automatically wraps to the 
  323.        next line. 
  324.  
  325.        3.1.2. YOUR NAME: 
  326.          You may, of course, enter anything you want here.  The only use 
  327.        PRINT-SAY makes of your entry is to include your name as the author 
  328.        of the .PRG file it creates.  (This does not appear on the report
  329.        itself.)
  330.  
  331.        3.1.3. ABSOLUTE OR RELATIVE COLUMN-ADDRESSING: 
  332.          This is a technical question, which need only be understood by 
  333.        a programmer who intends to customize the .PRG output file which 
  334.        PRINT-SAY is creating.  If you are not a programmer you need only 
  335.        press the [Enter] key and accept the default answer. 
  336.          (Default means that if you simply press the [Enter] key without 
  337.        having typed in an answer, PRINT-SAY will use the answer offered 
  338.        in the DEFAULT window.  Default has nothing to do with fault, as 
  339.        in blame!) 
  340.          dBASE provides two ways of sending the printer's print-head to 
  341.        a particular place (address) on the paper. Absolute addressing 
  342.        code says: put such-and-such a line on column five, row ten of the 
  343.        paper.  Relative addressing say: put the next line one column down 
  344.        and two rows over from the last line.  There are advantages to 
  345.        both sorts of addressing when it comes to modifying a printer pro- 
  346.        gram; the programmer will need to consider which form of addressing 
  347.        will be easiest to customize in any given report situation. 
  348.  
  349.  
  350.        3.1.4. ALLOW COMPRESSED PITCH: 
  351.          Once you have finished answering PRINT-SAY's questions and it 
  352.        therefore knows how many fields you want, how wide they will be, 
  353.        and what width paper you will be using, PRINT-SAY attempts to 
  354.        reconcile all these numbers. 
  355.          For example, if you will be using regular letter-sized paper, 
  356.        which is 8.5" wide, this allows you to show your data in up to 
  357.        80 characters across the page. . . IF pica pitch is used.  80 
  358.        characters isn't that much, considering how many fields the aver- 
  359.        age database contains!  If you need to display more the 80 chars. 
  360.        across, you could switch to using wider paper.  But - unlike the 
  361.        Report Generator in dBASE - PRINT-SAY allows you the alternative 
  362.        of using the narrower elite pitch, which permits 96 characters to 
  363.        show across the letter-sized page. 
  364.          That is a bit more of a margin but not nearly enough for many 
  365.        Jobs.  The vast majority of printers support an even narrower 
  366.        pitch called compressed which allows 137 chars. across an 8.5" 
  367.        page.  Whether you wish to use this pitch is ultimately an aesthetic 
  368.        judgement and is therefore left up to you to decide.  That is the 
  369.        purpose of this question: to allow you to choose whether PRINT-SAY 
  370.        will drop down to compressed pitch when you need it. 
  371.          Of course, a little thought reveals a further possibility this 
  372.        opens the door to:  With wider paper AND elite or compressed pitch 
  373.        one can really begin to get a good look at one's database in one 
  374.        report. 
  375.  
  376.        3.1.5. WIDTH OF PAPER: 
  377.          There are three common widths of paper: letter (8.5"), legal (11"), 
  378.        and legal inserted side-ways (14").  For your convenience, the 8.5  
  379.        or letter paper has been abbreviated to 8 and is the default (no type)  
  380.        answer as well. 
  381.  
  382.        3.1.6. LENGTH OF PAPER: 
  383.          Ditto WIDTH - the default is the normal 11". 
  384.  
  385.        3.1.7. SEPARATORS: 
  386.          Your report will be a series of columns, each one being a field 
  387.        from your database.  The separator is the number of blanks you 
  388.        want to separate these columns on the page.  Two is the default 
  389.        answer. 
  390.  
  391.        3.1.8. BAR CHARACTER: 
  392.          Each report you create has some header lines at the top of the 
  393.        page followed by the main body of columns of data.  To separate the 
  394.        two PRINT-SAY draws a line across each page.  The character you en- 
  395.        ter here is repeated as many times as necessary to get across the 
  396.        page.  The default is an equal sign (=), you may enter any other 
  397.        single character you choose to take it's place. 
  398.          Advanced users: you may want to use an upper ASCII character from 
  399.        the box-drawing set, such as (decimal) #196 or #205.  You would en- 
  400.        ter this using [Num Lock] plus [Alt] plus the appropriate digits, or 
  401.        whatever variation is appropriate on your computer. 
  402.  
  403.  
  404.                              -  THROW-AWAYS - 
  405.  
  406.  
  407.        3.1.9. OUT-PUT FILE NAME: 
  408.          PRINT-SAY creates a file containing a dBASE .PRG program when 
  409.        it has finished asking its twenty questions.  Each file it creates 
  410.        must have a name.  Each file name must be acceptable to MS-DOS. 
  411.        See your DOS manual if that puzzles you.  The name you enter here 
  412.        may be a full drive and path name if it suits your purposes, such 
  413.        as 
  414.                         \DBASE\WINIFRED\REPORT1.PRG 
  415.                                     or 
  416.                       C:\ACCOUNTS\AUDIT\TRAIL\AR.PRG 
  417.  
  418.           - but will usually be only 1 to 8 characters followed by the 
  419.        .PRG ending.  In other words this file name follows the same rules 
  420.        used when creating a database file or an index, except the 
  421.        ending is .PRG.  (If the above path examples are Greek to you - 
  422.        relax! - that means you don't need to use them!) 
  423.          The .PRG ending is not necessary but traditional for informing 
  424.        the programmer which files contain his code.  PRINT-SAY will add 
  425.        the .PRG ending if it finds no period in your answer. 
  426.          The DEFAULT file name is PRNTCODE.PRG; 
  427.          However, whatever name you use, keep in mind that 
  428.   
  429.           ---------------------------------------------------------- 
  430.          | ONLY ONE FILE WITH THAT NAME CAN EXIST AT THE SAME TIME! | 
  431.           ---------------------------------------------------------- 
  432.  
  433.        on your diskette or hard disk sub-directory.   
  434.          So if you use PRNTCODE.PRG, for example, more than once on the 
  435.        same disk (or hard disk) the previous file will be over-written (and 
  436.        therefore destroyed) by the new file.  This is why PRINT-SAY will 
  437.        check with you before using the same name a second time. 
  438.  
  439.        3.1.10. REPORT TITLE: 
  440.          This is a descriptive phrase which you enter to head your re- 
  441.        port.  It should not be more than fifty-five characters long if 
  442.        you are using 8 1/2" wide paper, or seventy characters long if 
  443.        you are using 11" or 14" wide paper. 
  444.          If you enter no report title: no problem - that header will 
  445.        simply show a blank between the date and the page number. 
  446.  
  447.        3.1.11. DATABASE: 
  448.          You know what this question wants, I'm sure.  However, if you 
  449.        press [Enter] without typing in a name PRINT-SAY simply leaves out 
  450.        the USE SUCH&SUCH command from the file it is making.  Program- 
  451.        mers will occasionally do this. 
  452.  
  453.        3.1.12. INDEXES: 
  454.          Ditto the above comments under DATABASE.  In some cases you may 
  455.        wish to list more than one index (separated by commas), even though 
  456.        only the first one will affect the database and the printer report. 
  457.        Multiple indexes are used in tasks like EDIT and APPEND and DELETE,  
  458.        which modify a database, in order to keep all indexes current. 
  459.  
  460.        3.1.13. CONDITIONAL IF STATEMENT: 
  461.          This is a more advanced feature - beginners should skip.  An 
  462.        "if" condition chooses which records will be listed (pass through 
  463.        the filter) and which will not.  A sample if filter is: 
  464.  
  465.                   IF (TAKEHOME > 569) .OR. (TAKEHOME < 1100) 
  466.  
  467.        - which would allow only those records with a value for the field 
  468.        TAKEHOME between $569 and $1100 to be printed in this report. 
  469.  
  470.        3.1.14. NUMBER OF FIELDS: 
  471.          When you list a database you want to see a certain number of 
  472.        its fields across the page; that's the number needed here.  It 
  473.        would be too dangerous and rarely useful to provide a default here, 
  474.        so PRINT-SAY will not let you continue until you type in a digit 
  475.        or two. 
  476.  
  477.  
  478.                             - FIELD-BY-FIELD - 
  479.  
  480.  
  481.      3.2. FIELD QUESTIONS: 
  482.        Once you have completed the fourteen questions asked by the Initial  
  483.      Questions mode of PRINT-SAY, it enters the Field-by-Field mode. Field- 
  484.      by-Field mode is a round-robin in which PRINT-SAY will ask you the same 
  485.      small group of questions over and over again.
  486.        For each of the number of fields you entered in Question 14, you 
  487.      will be asked the following questions: 
  488.  
  489.  
  490.        3.2.1. FIELD TITLE: 
  491.          Over each field, or column, in your print-out you may have a 
  492.        descriptive heading title.  With the dBASE LIST command you are 
  493.        forced to accept the name of the field, itself.  Here, you have a 
  494.        choice; however, it is best to keep the title from being signifi- 
  495.        cantly longer than the width of the column it heads when possible. 
  496.  
  497.        3.2.2. FIELD CONTENT: 
  498.          This is the actual field name you assigned to the field when you 
  499.        created the database.  It is usually helpful to  LIST STRUCTURE TO 
  500.        PRINT  before running PRINT-SAY to refresh your memory for these 
  501.        field titles and their sizes (next question).  Advanced dBASE 
  502.        users may want to enter some tricky phrases here like 
  503.  
  504.                   TRIM(SURNAME) + ', " + TRIM(FIRSTNAME) 
  505.                                     or 
  506.                           SUBSTR(CREDITLINE,1,6) 
  507.                                     or 
  508.                                B->M_EMPL_DATE 
  509.  
  510.        which allow the raw field contents to be modified accordingly. 
  511.          If the field title you entered in the previous question is the 
  512.        same as the actual field name in the database, you may press 
  513.        [Enter] to default to your last answer. 
  514.          One disappointment: MEMO fields cannot be printed with PRINT- 
  515.        SAY.  Sorry! 
  516.  
  517.        3.2.3. IS FIELD NUMERIC: 
  518.          This question is needed so PRINT-SAY can determine whether or 
  519.        not to ask questions 5 and 6.  Answer yes for any field that shows 
  520.        an "N" in the "Type" column of the LIST STRU printout; answer no 
  521.        for all other field types: character, date, logical. 
  522.  
  523.        3.2.4. FIELD SIZE: 
  524.          This is the width of the field in question as shown in the LIST 
  525.        STRUCTURE of the database.  Or, for tricky users, it may be some 
  526.        number smaller than the full amount if the answer to the previous 
  527.        question was also tricky. 
  528.          Because this number is so vital to PRINT-SAY, it will not let 
  529.        you continue until you've entered one or two digits and pressed 
  530.        [Enter]. 
  531.  
  532.        3.2.5. NUMBER OF DECIMALS: 
  533.          This question and the next are only asked for a field to which 
  534.        you answered "yes" to Question 3 (Numeric).  Enter the number of 
  535.        decimals shown in the "Dec" column from the LIST STRU printout. 
  536.  
  537.        3.2.6. SUB-TOTALS: 
  538.          If you want your report to show a running total of this field 
  539.        at the bottom of each page, answer with a "T". 
  540.          A note on sub-totals: PRINT-SAY gives the sub-total two extra  
  541.        digits to allow for the fact that adding up the contents of fifty 
  542.        numbers in a given column may create a larger number than is pro- 
  543.        vided for in the structure of the database for that field. 
  544.  
  545.      Once you have answered all questions to its satisfaction, PRINT-SAY 
  546.      will write the .PRG file to disk for you to use or modify, as you  
  547.      would any other .PRG file. 
  548.  
  549.  
  550.      3.3. PRINTSAY.DAT AND RE-USABLES: 
  551.        PRINT-SAY also creates a second file, PRINTSAY.DAT, which contains 
  552.      your answers to the first eight (Re-Usable) questions.  Thereafter, 
  553.      each time you use PRINT-SAY it will read your answers to the first  
  554.      eight questions from this file and offer them as the answers for these 
  555.      eight questions - while allowing you a chance to revise them if you 
  556.      desire. 
  557.        Each time you use PRINT-SAY it will ask if you wish to save the  
  558.      RE-USABLES answers you provided.  If you have made any changes during  
  559.      this session with PRINT-SAY which you will probably use the next time  
  560.      then answer with an "s" to save; otherwise enter an "f" to forget the  
  561.      changes.  If you answer "s", PRINTSAY.DAT is updated to match your 
  562.      current RE-USABLES. 
  563.        PRINTSAY.DAT is for PRINT-SAY's use: you need not worry about it.  
  564.      (Nor in sharing PRINT-SAY with another user do you need to include it 
  565.      on his diskette.)  If PRINTSAY.DAT is missing PRINT-SAY simply proceeds 
  566.      to make a new one. 
  567.        Hard-disk users: PRINT-SAY attempts to find PRINTSAY.DAT in the cur- 
  568.      ent working directory and to update or create it there, as well. Keeping  
  569.      PRINTSAY.DAT with your work in a sub-directory has the advantages of al- 
  570.      lowing you to have different sets of Re-Usable answers for different  
  571.      projects and of allowing more than one user of PRINT-SAY on the same  
  572.      machine.  On the other hand, if you wish to keep PRINTSAY.DAT in some 
  573.      other sub-directory, not finding a copy in the current directory, 
  574.      PRINT-SAY will ask you for the path to the directory you are keeping 
  575.      it in.  (If you don't have a copy in this other sub-directory, you must 
  576.      put one there before starting PRINT-SAY.) 
  577.       
  578.  
  579.  
  580.  
  581.                                  SECTION 4 
  582.                    -  Clique.dbf: Taking a Guided Tour - 
  583.  
  584.       4.1. GETTING STARTED: 
  585.         The best way to get a handle on something new is to follow an 
  586.       example case from beginning to end.  On your distribution diskette 
  587.       you will find a dummy database called Clique.  To get started,  USE 
  588.       CLIQUE  and  BROWSE  or  EDIT  a bit to take a look around, then 
  589.       LIST STRU TO PRINT  to get a printout of its field structure like 
  590.       this: 
  591.  
  592.                    . use clique 
  593.                    . display structure 
  594.                    Structure for database: B:clique.dbf 
  595.                    Number of data records:      17 
  596.                    Date of last update   : 03/24/87 
  597.                    Field  Field Name  Type       Width    Dec 
  598.                        1  SURNAME     Character     20 
  599.                        2  FIRST       Character     15 
  600.                        3  TITLE       Character      4 
  601.                        4  STREET      Character     30 
  602.                        5  CITY        Character     20 
  603.                        6  PROV        Character     15 
  604.                        7  ZIP         Character      7 
  605.                        8  PHONE       Character      8 
  606.                        9  DUES_PAID   Numeric        6      2 
  607.                       10  DATE_PAID   Date           8 
  608.                    ** Total **                     134 
  609.  
  610.  
  611.       Type  RUN PRINTSAY  (or simply  PRINTSAY , if you must work from 
  612.       the DOS prompt).  The screen will fill up with turquoise boxes 
  613.       (if you have a colour monitor, that is).  If you have used PRINT-SAY 
  614.       before you will be asked for the answer to Question 8; if this is 
  615.       your first time through it will naturally ask for the answer to 
  616.       Question 1 - for simplicity let's start with Question 1.  So if 
  617.       your have used PRINT-SAY before and you want to follow through 
  618.       with this tour, enter the command  RUN DEL PRINTSAY.DAT  at your 
  619.       dot-prompt (or the same command without the RUN at the DOS prompt). 
  620.       This will clear away the "Re-Usable Answers" stored from your 
  621.       previous run - no great loss, since they're so easy to re-enter. 
  622.  
  623.       4.2. THE RE-USABLE QUESTIONS: 
  624.         Press the [Caps Lock] key then type in the following: "MOOSE FALLS 
  625.       CLUB OF VERY IMPORTANT PERSONS" then press [Enter] to let PRINT-SAY 
  626.       know when you've finished.  (You needn't type the quotes - they're 
  627.       only there to mark off the answer.)  As you type your text appears 
  628.       in the bottom window labeled YOUR ANSWER. 
  629.         As soon as you press the [Enter] key your MOOSE FALLS entry popped 
  630.       into the big window and the QUESTION and DEFAULT prompts changed to 
  631.       present Question 2, which asks for your name.  This may seem nosy 
  632.       of PRINT-SAY, but all it wants to do is to give you credit as the 
  633.       programmer in the .PRG file it is creating as we go.  Type in your 
  634.       name and press the [Enter] key again.  Question 3 appears. 
  635.         Let's practice laziness and get rid of Question 3's irritating 
  636.       technicality in one stroke - tap a finger on the [Enter] key.  This 
  637.       is technically known as accepting the default, which means that the 
  638.       answer offered up in the DEFAULT window is transferred to the LIST 
  639.       OF RESPONSES window and PRINT-SAY swallows the answer "Absolute", 
  640.       just as if you knew what the heck you were talking about. 
  641.         Now the fourth question appears - let's be lazy here, too: zap in 
  642.       the default "Yes" answer.  Probably you can do the same thing for 
  643.       the next two questions as well, unless you've got wide paper in 
  644.       your printer right now and are too lazy to change it to normal 8.5" 
  645.       width paper for this exercise.  Given the power of the path of least 
  646.       resistance, let's change the default for Question 7 to accept a 
  647.       separator width of "3".  (Don't know what that means?  See Section 
  648.       3.1.7.)  Then let's accept the default for Question 8. 
  649.         Now we've finished the Re-Usable Answers Section.  Your responses 
  650.       to these first eight questions will be saved in a file and recalled 
  651.       each time PRINT-SAY is re-started from the directory you are now in. 
  652.       (Nothing is forced on you, however: you will be offered a chance to 
  653.       revise the answer to each and every question in PRINT-SAY before it 
  654.       goes on to do its work.) 
  655.  
  656.       4.3. THROW-AWAYS: 
  657.         For Question 9 you COULD accept the default, as well: but it's a 
  658.       bad habit to get into, given the casual way DOS destroys files by 
  659.       writing over them whenever a new file is created with the same name 
  660.       and path.  Therefore, type in "REPORT-A" and press [Enter].  Notice 
  661.       PRINT-SAY has added the .PRG extension for you. 
  662.         Question 10: type in "STATEMENT OF BALANCE OF DUES" and press 
  663.       [Enter].  Question 11: answer "CLIQUE", which is the name of the  
  664.       .DBF file we're using for this exercise.  For Question 12 answer  
  665.       CLIQNAME, which is the index provided, which is keyed to the SURNAME  
  666.       and FIRST fields.  (Of course, if we wanted to keep more than one 
  667.       index open we would type their names with the active one first and 
  668.       the rest separated by commas.) 
  669.         For the second-last question press [Enter] again to accept the 
  670.       default answer of NONE.  For the last question type in the numeral 
  671.       "8" and press [Enter].  Now the right half of your screen should 
  672.       look like this: 
  673.                               --LIST OF RESPONSES:------------------- 
  674.                               |                                     | 
  675.                               |       <- Re-Usable Answers ->       | 
  676.                               |                                     | 
  677.                               | 1.Logo Header->MOOSE FALLS CLUB OF V| 
  678.                               | 2.Your Name--->A. PROGRAMMER        | 
  679.                               | 3.Absl/Rel.--->Absolute             | 
  680.                               | 4.Compress OK->Yes                  | 
  681.                               | 5.Page Width-->8                    | 
  682.                               | 6.Page Length->11                   | 
  683.                               | 7.Separators-->3                    | 
  684.                               | 8.Bar Chrcter->=                    | 
  685.                               |                                     | 
  686.                               |          <- Throw-Aways ->          | 
  687.                               |                                     | 
  688.                               | 9.Output File->REPORT-A.PRG         | 
  689.                               | 10.Job Title-->STATEMENT OF BALANCE | 
  690.                               | 11.Database--->CLIQUE               | 
  691.                               | 12.Indexes---->CLIQNAME             | 
  692.                               | 13.Filter----->None                 | 
  693.                               | 14.# of Fields>8                    | 
  694.                               |                                     | 
  695.                               --------------------------------------- 
  696.  
  697.       4.4. REVISIONS: 
  698.         Voila!  The box titles turned green and the QUESTION box indicates 
  699.       the PRINT-SAY is now accepting offers to change previous answers. 
  700.       For practice let's try this out: type in "7" and press [Enter]. Enter 
  701.       the number "2".  Since it responds by offering to accept another 
  702.       change, enter a "9".  Too lazy to think of a new title?  - No prob- 
  703.       lem: simply press [Enter] before you type anything else and the old 
  704.       answer is preserved.  O.K. let's back out of REVISION MODE by press- 
  705.       ing [Enter] one more time. 
  706.  
  707.       4.5. FIELD QUESTIONS: 
  708.         Now the box titles turn yellow and the QUESTION box wants the first 
  709.       field title.  (This is NOT the same as the field NAMES you get from 
  710.       LIST STRU printout.  PRINT-SAY calls those `field contents'.)  In- 
  711.       stead, what is wanted here is the phrase you want to appear over the 
  712.       first column of data in the report we are making.  We're going to be 
  713.       creating a report which lists the title, last name, first name, street 
  714.       address, phone number, dues paid, dues owing, and date of payment for 
  715.       each club member.  Thus, the first field will need a name indicating 
  716.       that it will contain each member's "title", I can't think of anything 
  717.       better than that in this case so type in "Title". 
  718.         PRINT-SAY responds by changing the question to `Enter field #1 
  719.       contents:'.  Now PRINT-SAY wants to know the actual field name, which 
  720.       our LIST STRU printout says is also TITLE, so in this case we can be 
  721.       lazy again and press the [Enter] key to accept the default offering 
  722.       to use the field title as the field contents name. 
  723.         The LIST STRU shows a "C" under the "Type" column for this field 
  724.       so we will answer the new question 'Is field #1 numeric [T/F]?' 
  725.       with an "F" (or just an [Enter] key-press).  It may also be worth- 
  726.       while to note here that the answer to the numeric question comes from 
  727.       the "N" in the LIST STRU print-out. Some fields may contain numbers, 
  728.       for example in an address or phone number, yet be declared as char- 
  729.       acter fields to prevent dBASE performing arithmetic on them. 
  730.         The printout shows the size of the TITLE field to be 4, so enter a 
  731.       "4" as the answer to the next question. 
  732.  
  733.       4.6. REPEATING THE PROCESS: 
  734.         That takes us once through the FIELD-BY-FIELD loop.  Essentially,
  735.       now we need to repeat this process for the next four fields. This 
  736.       will take much longer to read about than to do, so let me simplify 
  737.       things by presenting the answers in a table: 
  738.  
  739.                  |-LIST OF RESPONSES:------------------| 
  740.                  |                                     | 
  741.                  | 1a.Title->Title                     | 
  742.                  | 1b.Data-->TITLE                     | 
  743.                  | 1c.Size-->4                         | 
  744.                  |                                     | 
  745.                  | 2a.Title->Last Name                 | 
  746.                  | 2b.Data-->SURNAME                   | 
  747.                  | 2c.Size-->20                        | 
  748.                  |                                     | 
  749.                  | 3a.Title->First Name                | 
  750.                  | 3b.Data-->FIRST                     | 
  751.                  | 3c.Size-->15                        | 
  752.                  |                                     | 
  753.                  | 4a.Title->Street Address            | 
  754.                  | 4b.Data-->STREET                    | 
  755.                  | 4c.Size-->30                        | 
  756.                  |                                     | 
  757.                  | 5a.Title->Phone No                  | 
  758.                  | 5b.Data-->PHONE                     | 
  759.                  | 5c.Size-->8                         | 
  760.                  |-------------------------------------| 
  761.  
  762.       So far you will have answered "F" each time the question 'Is field 
  763.       #1 numeric [T/F]?' is asked. 
  764.  
  765.       4.7. HANDLING NUMERIC FIELDS: 
  766.         The next two fields are a little different in that we are going 
  767.       to answer "True" to the numeric question.  So for the first quest- 
  768.       ion (field title) answer "Dues Paid"; for the next (field contents) 
  769.       answer "Dues_Paid"; for the next enter "T" to indicate that the 
  770.       field is in fact numeric; for the size enter "6".  Now, because 
  771.       we finally did admit to having a numeric field, PRINT-SAY asks two 
  772.       new questions.  For the number of decimals enter "2"; for whether 
  773.       or not we want sub-totals answer "T" again. 
  774.         The title for field #7 will be "Dues Owing" - fine; but for its 
  775.       contents let's do something a little different: enter: 
  776.        "100 - Dues_Paid".   The annual dues for the V.I.P. Club are $100, 
  777.       so, if anyone's Dues_Paid field contains a number less than 100, 
  778.       this formula will show the difference, which is of course the amount 
  779.       of dues that member still is owing.  For the rest of #7's questions 
  780.       answer the same as for #6, above. 
  781.  
  782.                  |-LIST OF RESPONSES:------------------| 
  783.                  |                                     | 
  784.                  | 6a.Title->Dues Paid                 | 
  785.                  | 6b.Data-->DUES_PAID                 | 
  786.                  | 6c.Size-->6N  2Decs  Sub-Totals     | 
  787.                  |                                     | 
  788.                  | 7a.Title->Dues Owing                | 
  789.                  | 7b.Data-->100 - DUES_PAID           | 
  790.                  | 7c.Size-->6N  2Decs  Sub-Totals     | 
  791.                  |                                     | 
  792.                  | 8a.Title->Date Rec'd                | 
  793.                  | 8b.Data-->DATE_PAID                 | 
  794.                  | 8c.Size-->8                         | 
  795.                  |                                     | 
  796.  
  797.         Field #8 - the last - is not numeric and follows the pattern of 
  798.       the first five questions. 
  799.  
  800.       4.8. FIELD-BY-FIELD REVISIONS: 
  801.         Now, technically, you've answered all questions and are done. 
  802.       However, PRINT-SAY has switched back to answer-revision mode in 
  803.       case you have any second thoughts about your field-by-field entries. 
  804.       Let's experiment with this just as a learning experience. 
  805.         Enter a "1" to revise the first field.  You are taken through 
  806.       the whole question-cycle again for this field; however, we don't 
  807.       want to change anything about this field except its size.  Press 
  808.       [Enter] thrice, therefore, to by-pass changing the first three an- 
  809.       swers.  Now PRINT-SAY is asking 'And field #1 size [1-99]:' again; 
  810.       this time enter 99!  PRINT-SAY responds by accepting this with a 
  811.       error warning where it displays the accumulated width and pitch and  
  812.       asks if there is anything else you would like to change. Press [Enter]  
  813.       to accept the exit default - now we've really got an ERROR message! 
  814.       That's why we entered 99 above: to test out this safety feature in 
  815.       PRINT-SAY. 
  816.         What PRINT-SAY is upset about is that, even when it tried using 
  817.       the smallest, compressed pitch, it still couldn't stuff a 99-width 
  818.       field together with the two 6-width and the one 8-width fields across 
  819.       one 8.5" wide sheet of paper. Compressed allows 137 characters across, 
  820.       minus a small safety margin leaving 134; we're asking for 144, which 
  821.       leaves 10 characters out in the cold, off to the right of the page. 
  822.       We are here offered a chance to change any or all of the three fac- 
  823.       tors which affect this problem: the page-width, the field column- 
  824.       width, and the separator-width.  Let's choose "F" to go back into 
  825.       answer revision mode.  Follow the procedure in the last paragraph 
  826.       to revise the first field and reduce its field size back to 44. 
  827.       Press [Enter] to exit revision mode and - voila! PRINT-SAY is happy. 
  828.         Press the "E" key to exit the error-correction module; PRINT-SAY 
  829.       makes all its calculations and first writes a file to disk called 
  830.       PRINTSAY.DAT, which stores your answers to the first six (re-usable) 
  831.       questions, then writes a file with the name we've assigned: 
  832.       REPORT-A.PRG, to disk and exits, returning us to the dull, ordinary 
  833.       world of the dot prompt. 
  834.  
  835.       4.9. RUNNING THE REPORT: 
  836.         And that is that!  You've created a full-fledged official dBASE 
  837.       .PRG file.  Want to see it?  - at the dot prompt type   MODI COMM 
  838.       REPORT-A  and [Enter].  This puts you into dBASE's built-in primitive 
  839.       text editor, where we can see the .PRG file's dBASE code.  Use the 
  840.       [PgDn] and [PgUp] keys to browse through this file, then press the 
  841.       [Esc] key to exit when done looking. 
  842.         To run the .PRG file type  DO REPORT-A , now, at the dot-prompt. 
  843.       The screen is re-written with a header and a set of instructions 
  844.       prompting the user to turn on and adjust the printer then press 
  845.       any key to start printing.  (To back out press the [Esc] key again.) 
  846.  
  847.       4.10. WHERE TO GO FROM HERE: 
  848.         If you're not already a dBASE programmer your next step is to 
  849.       make use of the knowledge you've gained so far.  After you've used 
  850.       PRINT-SAY for a week or three go on to read the second half of this 
  851.       manual, PRINTSAY.DOC, and take a step-by-step tour through the pro- 
  852.       cess of making modifications to a .PRG file. 
  853.  
  854.        * PRINTSAY.COM, PRINTSAY.DOC and CUSTMIZE.DOC are (c) Copyright 
  855.                      1988, by Dale Cotton, Toronto, Canada.
  856.                               All Rights Reserved. 
  857.