home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / doc301.zip / DOC.MAN < prev    next >
Text File  |  1992-12-15  |  43KB  |  1,221 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.                                        DOC
  17.  
  18.                      Source Code Documenter for Clipper 5.0x
  19.  
  20.                                   Version 3.01
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.                                Copyright (C) 1991
  32.                           Clarity Computer Consultants
  33.                                  1831 - 13th St.
  34.                                 Moline, IL 61265
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                         1
  62.  
  63.  
  64.  
  65.  
  66.                                  DOC IS NOT FREE
  67.  
  68.           DOC is not, and has never been, free. It is shareware.  Share-
  69.         ware is software you can try before purchasing. After trying it
  70.         for a reasonable time you must either register or delete it from
  71.         your hard disk.  Registration is US $70.  When you register you
  72.         will receive a registration # by E-Mail, phone or fax to turn off
  73.         the UNREGISTERED VERSION messages and a printed Users Manual by
  74.         mail.
  75.  
  76.           To register by credit card log onto CompuServe and GO SWREG.
  77.         DOC's Registration ID is 519.  When you register via CIS you will
  78.         received your registration # by CompuServe Mail within 24 hours.
  79.  
  80.           You can also register by mailing a check or money order payable
  81.         in US funds to
  82.  
  83.                           Clarity Computer Consultants
  84.                                   1831-13th St.
  85.                                 Moline, IL 61265
  86.                                        USA
  87.  
  88.           When registering by mail, if you send a money order or a certi-
  89.         fied check and a phone or fax number where we can reach you we
  90.         will phone or fax you your registration # the day we receive
  91.         payment.  Otherwise, we will phone, fax or mail you your regis-
  92.         tration # when payment is confirmed and send the printed manual
  93.         by mail.
  94.  
  95.           To contact the author with problems or questions send a message
  96.         via CompuServe to
  97.  
  98.                          David Barrett, CIS # 72037,105
  99.  
  100.         or by mail to Clarity Computer Consultants at the above address.
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.                                         2
  123.  
  124.  
  125.  
  126.                                     CHAPTER I
  127.                                     Overview
  128.  
  129.         DOC, the Source Code Documenter for Clipper 5.0x code, will read
  130.         your Clipper source code files and rewrite them into another
  131.         directory, indenting the code to show program control structures,
  132.         inserting a file header listing all the functions and procedures
  133.         in the file and a function header preceding each function and
  134.         procedure listing all the other functions which call or are
  135.         called by this function, lists the parameters and provides space
  136.         for the programmer to insert comments for each parameter and to
  137.         state the function's purpose, output and assumptions.  These
  138.         programmer comments in the headers are supported by DOC in that
  139.         each time DOC documents your source code it saves any existing
  140.         comments and reinserts them in the new header.  DOC saves the
  141.         name of the parameter with the parameter comments so that even if
  142.         the parameter order has been changed DOC will keep the comment
  143.         with the correct parameter.
  144.  
  145.         DOC now allows you to configure the appearance of the function
  146.         headers.
  147.  
  148.         DOC can also send your source code files to the printer, or print
  149.         to disk.  The printed source code files have page headers insert-
  150.         ed at the top of each page and a Table of Contents, listing the
  151.         page on which each function and parameter starts.  DOC can op-
  152.         tionally also insert line numbers in printed source code files.
  153.         DOC will optionally also create an action diagram for each source
  154.         code file with lines marking the program control structures.  The
  155.         printed action diagrams also have page headers, Table of Contents
  156.         and, optionally, line numbers inserted.
  157.  
  158.         DOC can create a list of source code files to be documented
  159.         automatically from a make file or any ASCII text file in which
  160.         the names of the source code files appear.  Clipper library
  161.         functions and other functions can be listed in KEY files, identi-
  162.         fying them to DOC.  For each KEY file you can tell DOC whether or
  163.         not the functions in that library should be listed in the headers
  164.         and reports.  DOC can also change the capitalization in your
  165.         source code of the name of functions listed in the key files.
  166.         Capitalization choices are all lower case, all upper case, first
  167.         letter capitalized or case changed to match the capitalization in
  168.         the Key File.
  169.  
  170.         DOC optionally also creates a Function and Procedure Report
  171.         listing each function and procedure in the source code files in
  172.         either alphabetical or order read or both.  Each function and
  173.         procedure is listed with a list of functions called, the func-
  174.         tion's parameters and comments and the other programmers com-
  175.         ments.
  176.  
  177.         DOC can optionally create a Cross Reference Report listing every
  178.         word found in the source code.  The report lists the source code
  179.         file, function name and line number for each occurrence of the
  180.         word.  Optionally DOC will include or omit function names listed
  181.  
  182.  
  183.                                         3
  184.  
  185.  
  186.  
  187.         in the key files.
  188.  
  189.         DOC can optionally create a database and index file report for
  190.         every database and index file explicitly named in a USE or INDEX
  191.         command (or in a * SNAPCODE comment) that it can find on disc,
  192.         listing for each DBF file its structure and the index files
  193.         associated with it and for the index file the index key expres-
  194.         sion.  DOC also creates an include file for each dbf file with
  195.         handy preprocessor defines of the field names for scatter and
  196.         gathering to an array and a structure array for creating the
  197.         database using dbcreate() when it does not exist.
  198.  
  199.         DOC creates a report, called STAT.DOC, which lists the number of
  200.         lines of code, the number of lines of DOC created headers, total
  201.         lines and number of functions in each source code file and totals
  202.         for all the source code files.
  203.  
  204.         DOC optionally creates a Index and a Table of Contents document
  205.         listing all the functions and procedures in the system with the
  206.         page number and name of the name of the source code file for
  207.         each.  The Index document lists the functions and procedures in
  208.         alphabetical order and the Table of Contents lists them in the
  209.         order read.
  210.  
  211.         DOC, in conjunction with a Norton guide compiler and linker such
  212.         as those that are supplied with Expert Help, can create a Norton
  213.         Guide database for all the functions and procedures in the system
  214.         using the parameter list for the syntax and the programmer's
  215.         comments for the text.  DOC creates the NGC compile file, the NGL
  216.         link file and a batch file which, when run, automatically com-
  217.         piles and links the guide.  DOC supports creating multiple func-
  218.         tion lists within a Norton Guide Database and also See Also:
  219.         references.
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.                                         4
  245.  
  246.  
  247.  
  248.  
  249.                                    CHAPTER II
  250.                      Running DOC and Command Line Parameters
  251.  
  252.         A. DOCPATH Environmental Variable
  253.           DOC creates a number of temporary databases while it is proc-
  254.         essing which it erases before terminating.  DOC looks for an
  255.         environmental variable named DocPath.  If found it creates its
  256.         temporary files in the drive and directory specified by this
  257.         variable.  If there is no DocPath in the environment it looks for
  258.         an environmental variable named TEMP and uses the drive and
  259.         directory specified by it.  If it finds neither it uses the
  260.         current DOS directory for its temporary files.
  261.           If you have a RAM drive that is big enough (2 or 3 MBytes
  262.         should be big enough if you are not documenting a HUGE applica-
  263.         tion) set DocPath to it.  Otherwise, it would be good to specify
  264.         a directory where you have no permanent files to avoid any possi-
  265.         bility of a name collision.
  266.  
  267.         B. RUNNING DOC
  268.           If the file DOC.EXE resides in a directory in your path you can
  269.         invoke DOC from any DOS prompt.  There are three command line
  270.         parameters which DOC understands.  These parameters are useful
  271.         mostly for running DOC unattended from a make or batch file.
  272.  
  273.                          DOC [-S<path>] [-C<name>] [-G]
  274.  
  275.  
  276.         C. THE -S PARAMETER
  277.           This command sets the Make File and Source Code Path (the
  278.         directory containing the configuration file and the make file) to
  279.         <path>.  If DOC is being used interactively, (i.e. the -G command
  280.         line parameter is not being used) the Make File and Source Code
  281.         path can also be specified on the Enter System Variable screen.
  282.         See the Enter System Variable section of this manual for more
  283.         information about the Make File and Source Code Path.
  284.  
  285.  
  286.         D. THE -C PARAMETER
  287.           This command sets the Configuration File name to something
  288.         other than the default CONFIG.DOC.  If several programming
  289.         projects share a source code directory only one of them can use
  290.         the default name of CONFIG.DOC for its configuration file and the
  291.         others must specify a different name whenever DOC is started.  If
  292.         DOC is being used interactively, (i.e. the -G command line param-
  293.         eter is not being used) the Configuration File name can also be
  294.         specified on the Enter System Variable screen. See the Enter
  295.         System Variable section of this manual for more information about
  296.         the Configuration File name.
  297.  
  298.  
  299.         E. THE -G PARAMETER
  300.            This command causes DOC to skip the menus and start document-
  301.         ing.  This can only be done successfully when DOC has been run at
  302.         least once interactively and the menus and input screens have
  303.  
  304.  
  305.                                         5
  306.  
  307.  
  308.  
  309.         been used to create a Configuration File for the particular
  310.         programming project to be documented including the list of source
  311.         code files.  Once the configuration is set and the user is satis-
  312.         fied with the way DOC is documenting that set of source code
  313.         files (i.e. no more changes need to be made to the configuration)
  314.         then DOC can be invoked with the -G parameter so that the menus
  315.         are skipped and DOC immediately begins documenting.
  316.  
  317.  
  318.         F. EXAMPLES OF USE OF COMMAND LINE PARAMETERS
  319.            The following line in a batch or make file:
  320.  
  321.                   DOC -sD:\CLIPPER5\SOURCE\MYAPP -cMYAPP.CFG -g
  322.  
  323.         would run DOC unattended assuming there was a DOC configuration
  324.         file named MYAPP.CFG in the directory D:\CLIPPER5\SOURCE\MYAPP.
  325.         The following lines in a batch file:
  326.  
  327.                  D:
  328.                  CD \CLIPPER5\SOURCE\MYAPP
  329.                  DOC -G
  330.  
  331.         would run DOC unattended assuming there was a DOC configuration
  332.         file named CONFIG.DOC in directory D:\CLIPPER5\SOURCE\MYAPP.
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.                                         6
  367.  
  368.  
  369.  
  370.  
  371.                                    CHAPTER III
  372.                              Enter System Variables
  373.  
  374.  
  375.         A. MAKE FILE AND SOURCE CODE PATH
  376.           The Make File and Source Code Path is the directory in which
  377.         DOC looks for source code files which are listed without a path,
  378.         where it looks for the make file and in which it creates and from
  379.         which it reads the Configuration File.  If this variable is left
  380.         blank the current DOS directory is the Make File and Source Code
  381.         Path.
  382.  
  383.  
  384.         B. CONFIGURATION FILE NAME
  385.           If this variable is left blank DOC uses the default name of
  386.         CONFIG.DOC.  If there already is a file with this name or you
  387.         want more than one configuration of DOC with the same Make File
  388.         and Source Code Path you must specify another name.  DOC stores
  389.         all variables set through the menus in the Configuration File.
  390.  
  391.           When DOC is run interactively, after prompting the user for the
  392.         Make File and Source Code Path and the Configuration File name,
  393.         if a configuration file with the specified name in the specified
  394.         directory exists, it is read and all variables are set as they
  395.         were when that configuration was last saved.  If no configuration
  396.         file already exists the system variables are set to default
  397.         values.
  398.  
  399.  
  400.         C. MAKE FILE NAME
  401.           Type in the name of the make file, or an ASCII text file con-
  402.         taining the names of the source code files for the programming
  403.         project to be documented, if one exists.  The file must be in the
  404.         Source Code directory and if no extension is specified an exten-
  405.         sion of RMK is assumed.  If the file name has no extension put a
  406.         period at the end of the name.
  407.  
  408.  
  409.         D. NAME OF APPLICATION, AUTHOR and COPYRIGHT HOLDER
  410.           The data typed in these 3 fields will be used in the file
  411.         headers DOC creates for all output source code files and reports.
  412.  
  413.  
  414.         E. OUTPUT FILE PATH
  415.           Specify a directory where the output source code files, action
  416.         diagrams, reports and print to disk files will be created.  This
  417.         must be different than the Source Code Path or other directories
  418.         where input source code files reside or there will be name con-
  419.         flicts between the input and output files.
  420.  
  421.  
  422.         F. KEY FILE PATH
  423.           The drive and directory where DOC expects to find the key files
  424.         specified in the key file list.
  425.  
  426.  
  427.                                         7
  428.  
  429.  
  430.  
  431.  
  432.  
  433.         G. DATABASE PATH
  434.            When DOC finds USE and INDEX statements in the source code it
  435.         tries to open the referenced database and index files to document
  436.         their structure and index expressions.  If the database and index
  437.         file names do not include a path DOC will look for the files in
  438.         the directory named here or in the default DOS directory if this
  439.         parameter is left blank.
  440.  
  441.  
  442.         H. EXITING THE SYSTEM DATA INPUT SCREEN
  443.            Press the ESC key when finished inputting data.  The Main Menu
  444.         screen will appear.
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.                                         8
  489.  
  490.  
  491.  
  492.  
  493.                                    CHAPTER IV
  494.                                   FILES SubMenu
  495.  
  496.         A. SYSTEM DATA <F1>
  497.            Pressing F1 brings up the System Data screen again.
  498.  
  499.  
  500.         B. KEY FILE LIST <F8>
  501.            Selecting this option places you in the Key File Names, Doc
  502.         Names and Capitalization screen.  Type in the names of your key
  503.         files including extension.  DOC will assume these files are in
  504.         the key file directory specified on the System Data screen.
  505.            If you leave the Doc Name column blank the functions listed in
  506.         that key file will be ignored by DOC.  If you type in a Doc Name
  507.         the functions in that key file will included in the file headers
  508.         and reports and will be listed as being "from" that Doc Name.
  509.            If you type a "L", "U", "F" or "K" in the Cap column then any
  510.         words in your source code which match a word in that Key File
  511.         will be capitalized (or uncapitalized) as specified :
  512.                 L - all lower case
  513.                 U - all upper case
  514.                 F - first letter capitalized, rest lower case
  515.                 K - capitalized the same as function name in the key
  516.         file.
  517.         *** WARNING *** If you are using the case sensitive feature of
  518.         the #define pre-processor directive be careful when using this
  519.         feature.
  520.            Press ENTER to be editing on the current line.  Press the down
  521.         arrow key to add a new line.  Press the ESC key when done.
  522.  
  523.  
  524.         C. FROM MAKE FILE <F2>
  525.            Selecting this option causes DOC to read the make file and
  526.         extract the names of all files with an extension of PRG or SCR
  527.         which it finds and creates the List of Files to be Documented.
  528.  
  529.  
  530.         D. EDIT FILE LIST <F3>
  531.            When you select this option you can edit the List of Files to
  532.         be Documented.  To add new source code file names use the down
  533.         arrow key to move to a blank line and type in the name.  Press
  534.         the DEL key to delete an existing name.  Be sure to specify a
  535.         path for any source code files which are not in the Source Code
  536.         Path drive and directory.  Press ESC key when done.
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.                                         9
  550.  
  551.  
  552.  
  553.  
  554.                                     CHAPTER V
  555.                                  OUTPUT SubMenu
  556.  
  557.         A. SOURCE CODE <F4>
  558.             When this option is selected a screen pops up with the fol-
  559.         lowing options.  On questions with non-numeric answers toggle
  560.         through the options by pressing any keys other than the arrow
  561.         keys.  Use the up and down arrow keys to move the cursor.  Press
  562.         the ESC key when done.
  563.  
  564.          1.) Write SourceCode files to output path   YES/NO
  565.         If YES, each source code file in the File List is rewritten to
  566.         the Output Directory with headers inserted and indented.
  567.  
  568.          2.) Print Source Code files                 YES/NO
  569.         If YES, each source code file is sent to a printer port or a disk
  570.         file with headers inserted, indented, page breaks and headers and
  571.         a Table of Contents.
  572.  
  573.          3.) Send Printed Source Code to   LPT1/LPT2/LPT3/COM1/COM2/FILE
  574.         If FILE, the Source Code files are printed to a file with an
  575.         extension of *.PRN in the output directory.  Otherwise the print-
  576.         ed source code is sent to the printer port selected.
  577.  
  578.          4.) Line numbers in printed source code       YES/NO
  579.         If YES, line numbers are inserted at the beginning of each line
  580.         of the printed file.
  581.  
  582.          5.) Write action diagrams to output path       YES/NO
  583.         If YES, each source code file is rewritten to the Output Directo-
  584.         ry with an extension .ACT, headers, indenting and lines marking
  585.         the program control structures.
  586.  
  587.          6.) Print action diagrams                      YES/NO
  588.         If YES, each action diagrams is sent to a printer port or printed
  589.         to disk with page breaks, headers and a Table of Contents.
  590.  
  591.          7.) Send Printed Action diagrams to  LPT1/LPT2/.../COM2/FILE
  592.         If FILE, the action diagrams are printed to files in the output
  593.         directory with an extension of .APN.  Otherwise they are sent to
  594.         the selected printer port.
  595.  
  596.          8.) Line numbers in printed action diagrams     YES/NO
  597.         If YES, line numbers are inserted at the beginning of each line
  598.         in the printed action diagrams.
  599.  
  600.          9.) Use graphics in action diagrams             YES/NO
  601.         If YES, IBM upper ASCII box-drawing characters are used to mark
  602.         the control structures in action diagrams.  If your printer
  603.         cannot print these characters properly select NO.
  604.  
  605.          10.) Final page eject in printed output           YES/NO
  606.         If NO, the page eject on the final page of printed output is
  607.         omitted.  This avoids extra blank pages when using utilities such
  608.  
  609.  
  610.                                         10
  611.  
  612.  
  613.  
  614.         as LJBOOK after printing to disk.
  615.  
  616.          11.) Spaces to indent comment lines        [Numeric input]
  617.         Number of spaces to indent file and function headers created by
  618.         DOC.  If you want only FUNCTION and PROCEDURE declaration lines
  619.         to start in Column 0 in your source code enter a number other
  620.         than 0 here.
  621.  
  622.          12.) Indent #if, #else, #endif                     YES/NO
  623.         If YES, #if #else and #endif are treated the same as IF, ELSE and
  624.         ENDIF in terms of indenting and in the action diagrams.  If NO,
  625.         they are not treated as program control structures.
  626.  
  627.          13.) Number of char/line in printer output   [Numeric input]
  628.         Number of characters per line your printer can handle.  Lines
  629.         longer than this a counted as 2 lines in determining page breaks.
  630.  
  631.          14.) Number of lines/page in printer output   [Numeric input]
  632.         Used when printing source code files, action diagrams or in
  633.         reports to determine where page breaks occur.
  634.  
  635.          15.) Number of spaces to indent per level    [Numeric input]
  636.         Number of spaces to indent each control level.  Three seems to be
  637.         a standard.  I prefer the look of 2, personally.
  638.  
  639.          16.) (O)verwrite, (A)bort, enter (N)ew name or
  640.              (R)ename existing file if already exists       O/A/N/R
  641.         Determines what DOC does when it is about to create a file in the
  642.         Output directory and it discovers a file with the same name
  643.         already there.  If O, it ignores the problem and overwrites the
  644.         existing file.  If A, it aborts processing.  If N, it prompts the
  645.         user for a new name for the file it is about to create.  If R, it
  646.         prompts the user for a new name for the existing file.
  647.  
  648.  
  649.         B. REPORTS <F5>
  650.           When this option is selected the user is presented with a
  651.         screen containing the following options:
  652.  
  653.          1.) Send printed reports to     LPT1/LPT2/LPT3/COM1/COM2/FILE
  654.         Determines where the reports are sent.
  655.  
  656.          2.) Create Data Directory and CH files            YES/NO
  657.         If YES, creates a Data Directory data base and a report for all
  658.         the databases and indexes it finds in the Source Code directory
  659.         which are referred to the source code.  It also creates a CH
  660.         include file with some handy preprocessor defines for each data-
  661.         base.
  662.  
  663.          3.) Create Index and TOC listing of functions      YES/NO
  664.         If YES, creates reports listing every function and procedure, the
  665.         source code file name in which it was found and the page number
  666.         in the source code where it starts.  (If neither source code
  667.         files or action diagrams are printed no page numbers are created
  668.         and all page numbers will be 0.)  The Index and Table of Contents
  669.  
  670.  
  671.                                         11
  672.  
  673.  
  674.  
  675.         are identical except for the order in which the functions appear.
  676.  
  677.          4.) Create Function report in read order            YES/NO
  678.         This is a report which lists all the functions and procedures in
  679.         the application along with all the information from its header,
  680.         source code, line number and source code file name.
  681.  
  682.          5.) Create Function report in alpha order            YES/NO
  683.         Same as above except the functions and procedures are listed in
  684.         alphabetical order.
  685.  
  686.          6.) Create Cross Reference Report                   YES/NO
  687.         This is a report which lists all the words in the source code,
  688.         listing for each one the source code file, function and line
  689.         number of each occurrence.  Enabling this report significantly
  690.         increases DOC's processing time and the space needed on the disc
  691.         for the DOC's temporary files.
  692.  
  693.          7.) Cross Reference Key Functions                   YES/NO
  694.         If this is disabled DOC ignores function names listed in the key
  695.         files when creating the Cross Reference Report.
  696.  
  697.  
  698.         C. ENTER FUNCTION HEADERS
  699.  
  700.          1.) The Enter Function Headers Input Screen
  701.         The input screen looks like this:
  702.  
  703.                      Enter Function Header Options
  704.  
  705.           (Read) Purpose Heading           "   Purpose :"
  706.           (Write) Purpose Heading          "   Purpose :"
  707.           (Read) Out Heading               "   Out     :"
  708.           (Write) Out Heading              "   Out     :"
  709.           (Read) Comment 1 Heading         "   Assumes :"
  710.           (Write) Comment 1 Heading        "   Assumes :"
  711.           (Read) Comment 2 Heading         "   Author  :"
  712.           (Write) Comment 2 Heading        "   Author  :"
  713.           (Read) See Also Heading          "  See Also :"
  714.           (Write) See Also Heading         "  See Also :"
  715.           (Read) Ngo File Heading          "   NgoFile :"
  716.           (Write) Ngo File Heading         "   NgoFile :"
  717.           (Read) First Header line         "*!*********************"
  718.           (Write) First Header line        "*!*************************************"
  719.           (Read) Last Header line          "*!*********************"
  720.           (Write) Last Header line         "*!*************************************"
  721.           (Read) Header left edge          "*!   "
  722.           (Write) Header left edge         "*!   "
  723.           Blank lines between sections       "Y"
  724.  
  725.  
  726.          2.) The Read and Write Variables.
  727.            The (Read) variables are used when DOC is extracting program-
  728.         mer comments from the code it is reading.  The (Write) variables
  729.         determine how the headers look in the output code, action dia-
  730.  
  731.  
  732.                                         12
  733.  
  734.  
  735.  
  736.         grams, function reports and Norton Guides.  Therefore, if you
  737.         have programmer comments in DOC created headers that you want to
  738.         retain you need to set the (Read) variables the way the matching
  739.         (Write) variables were set the last time DOC was run.
  740.  
  741.          3.) Examples
  742.           For example, if you wish your headers to look like this :
  743.         /* -------------------------
  744.         |     Function Main
  745.         |  Calls : MyFunc()
  746.         |        : MyFunc2()
  747.         | Overview : This is the main menu routine  Sets defaults.
  748.         |            Sets screen color defaults based on ISCOLOR()
  749.         |            unless given a B/W command line parameter.
  750.         | In       : Param1 - first command line parameter.
  751.         |          : Param2 - second command line parameter.
  752.         | Returns  : Nothing
  753.         | Comments : Expects MYDATA.DBF to be in the default directory.
  754.         -------------------------- */
  755.  
  756.           and the code contains these comments in a header created by a
  757.         previous version of DOC you would set the variables like this:
  758.  
  759.           (Read) Purpose Heading           "   Purpose :"
  760.           (Write) Purpose Heading          "  Overview :"
  761.           (Read) Out Heading               "   Out     :"
  762.           (Write) Out Heading              "   Returns :"
  763.           (Read) Comment 1 Heading         "   Assumes :"
  764.           (Write) Comment 1 Heading        "  Comments :"
  765.           (Read) Comment 2 Heading         "           :"
  766.           (Write) Comment 2 Heading        "           :"
  767.           (Read) See Also Heading          "           :"
  768.           (Write) See Also Heading         "           :"
  769.           (Read) Ngo File Heading          "           :"
  770.           (Write) Ngo File Heading         "           :"
  771.           (Read) First Header line         "*!************"
  772.           (Write) First Header line        "/* ---------------------------"
  773.           (Read) Last Header line          "*!************"
  774.           (Write) Last Header line         "---------------------------- */"
  775.           (Read) Header left edge          "*!   "
  776.           (Write) Header left edge         "|    "
  777.           Blank lines between sections       "N"
  778.  
  779.  
  780.         If the next time you run DOC you have changed your mind and you
  781.         want the headers to look like this:
  782.  
  783.         /* =======================
  784.         ||
  785.         ||     Function Main
  786.         ||
  787.         ||  Calls : MyFunc()
  788.         ||        : MyFunc2()
  789.         ||
  790.         || Overview : This is the main menu routine  Sets defaults.
  791.  
  792.  
  793.                                         13
  794.  
  795.  
  796.  
  797.         ||            Sets screen color defaults based on ISCOLOR()
  798.         ||            unless given a B/W command line parameter.
  799.         ||
  800.         || In       : Param1 - first command line parameter.
  801.         ||          : Param2 - second command line parameter.
  802.         ||
  803.         || Returns  : Nothing
  804.         ||
  805.         || Comments : Expects MYDATA.DBF to be in the default directory.
  806.         ||
  807.         ============================ */
  808.  
  809.          you would set the variables like this:
  810.  
  811.           (Read) Purpose Heading           "  Overview :"
  812.           (Write) Purpose Heading          "  Overview :"
  813.           (Read) Out Heading               "   Returns :"
  814.           (Write) Out Heading              "   Returns :"
  815.           (Read) Comment 1 Heading         "  Comments :"
  816.           (Write) Comment 1 Heading        "  Comments :"
  817.           (Read) Comment 2 Heading         "           :"
  818.           (Write) Comment 2 Heading        "           :"
  819.           (Read) See Also Heading          "           :"
  820.           (Write) See Also Heading         "           :"
  821.           (Read) Ngo File Heading          "           :"
  822.           (Write) Ngo File Heading         "           :"
  823.           (Read) First Header line         "/* -----------"
  824.           (Write) First Header line        "/* ============================"
  825.           (Read) Last Header line          "--------------"
  826.           (Write) Last Header line         "============================ */"
  827.           (Read) Header left edge          "|   "
  828.           (Write) Header left edge         "||   "
  829.           Blank lines between sections       "Y"
  830.  
  831.  
  832.          4.) The First and Last Header line variables.
  833.           You must make absolutely sure that no other lines in you code
  834.         match the First and Last Header line variables.  You also must be
  835.         aware that if you do not have the "(Read) Purpose Heading" varia-
  836.         ble set correctly, (it does not match the existing headers ) DOC
  837.         will not find you comments and that if you do not have the
  838.         "(Read) Last Header Line" variable set correctly DOC will treat
  839.         your entire source code like a comment and not document anything
  840.         [this does, however, speed up the processing <g>].
  841.  
  842.          5.) Leading and trailing spaces
  843.           DOC rtrims these variables so spaces on the left are signifi-
  844.         cant, but spaces on the right are ignored.
  845.  
  846.          6.) See Also and Ngo File Headings
  847.             Any programmer's comments placed in See Also and NGO file
  848.         sections of the function headers have special meanings to DOC
  849.         when it creates the Norton Guide database. If a Norton Guide
  850.         database is not to be created then these sections can be retitled
  851.         and used for something else, such as "History :" or "Changes :".
  852.  
  853.  
  854.                                         14
  855.  
  856.  
  857.  
  858.            See the chapter on Norton Guide Database creation for more
  859.         information on how DOC uses the programmer's comments typed into
  860.         these sections of the function headers.
  861.  
  862.  
  863.  
  864.         D. NORTON GUIDE CREATION INPUT SCREEN
  865.  
  866.          1.) The input screen looks like this:
  867.  
  868.            Long Name     "My Personal Library                "
  869.            Norton Guide Short Name                  "mylib   "
  870.            Default NGO File                         "MISC    "
  871.            Norton Guide Compile File Extension           "NGC"
  872.            Norton Guide Object File Extension            "NGO"
  873.            Norton Guide Link File Extension              "NGL"
  874.            Command to invoke Norton Guide compiler
  875.             " NGC                                            "
  876.            Command to invoke Norton Guide linker
  877.             " NGML                                           "
  878.  
  879.          2.)  Norton Guide Long Name
  880.           Whatever is entered here is written as the !name parameter in
  881.         the link file.  This is the name of the Norton Guide Database
  882.         created from this application. It defaults to the name of the
  883.         application as entered in the System Data menu.
  884.  
  885.          3.) Norton Guide Short Name
  886.           This must be a valid DOS base file name of up to 8 characters.
  887.         This will be the base file name of the link file and the *.NG
  888.         file.  It defaults to the base name of the make file entered in
  889.         the System Data menu.
  890.  
  891.          4.) Default NGO file
  892.           The object file for any functions for which no NGO file was
  893.         specified either in the header or by means of a NGOFile comment.
  894.         If left blank, functions without a NGO file specified either
  895.         through a NGOFILE comment or an entry in the NgoFile: section of
  896.         the function header will not be included in the Norton Guide.
  897.  
  898.          5.) Norton Guide Compile File Extension
  899.           If you are using Expert Help you may wish to change this to
  900.         "EHC".
  901.  
  902.          6.) Norton Guide Object File Extension
  903.           If you are using a version of the Expert Help linker which ex-
  904.         pects object files to have an extension of "EHO" you must enter
  905.         that here.
  906.  
  907.          7.) Norton Guide Link File Extension
  908.           If you are using Expert Help you may wish to change this to
  909.         "EHL".
  910.  
  911.          8.) Commands to invoke compiler and linker
  912.            If your Norton Guide Compiler and Linker are not in a directo-
  913.  
  914.  
  915.                                         15
  916.  
  917.  
  918.  
  919.         ry in the DOS path you must enter their full path names here.
  920.         These will be used in the batch file, named MAKENG.BAT, that DOC
  921.         creates to automatically compile and link the Norton Guide data-
  922.         base.
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.                                         16
  977.  
  978.  
  979.  
  980.  
  981.  
  982.                                    CHAPTER VI
  983.                          NORTON GUIDE DATABASE CREATION
  984.  
  985.         A.  DESIGNING THE NORTON GUIDE DATABASE
  986.           The Ngo File parameter in the headers allows the programmer to
  987.         set up multiple function lists and menus in the Norton Guide
  988.         database created by DOC. The way it works is if the user wants
  989.         the Norton Guide create by DOC to list the functions in multiple
  990.         lists selected from a menu rather than the default of all the
  991.         functions in one big list then the user needs to do some plan-
  992.         ning.
  993.  
  994.          1. Divide up all the functions in the application into a number
  995.         of groups.
  996.  
  997.          2. For each group select a menu name and a Ngo File name. The
  998.         Ngo File name must be a valid DOS base file name of up to 8
  999.         characters.
  1000.  
  1001.          3. Label each function with the Ngo File name of the group to
  1002.         which it belongs. This can be done either by typing it into the
  1003.         function header created by DOC following the Ngo File : prompt or
  1004.         by using a NgoFile comment line.  You can place NgoFile comments
  1005.         anywhere in your source code except inside function or file
  1006.         headers.  These comment lines must start with *, // or && (not
  1007.         /* ... */ style comments).  The first word must be NGOFILE fol-
  1008.         lowed by a valid, up to 8 character, DOS base file name.  All the
  1009.         functions following that line (until the next NgoFile comment or
  1010.         the end of the source code file) that do not have a group (Ngo
  1011.         File name) specified in the function header will be assigned to
  1012.         that function group.
  1013.  
  1014.          4. When DOC is next run it will create a separate .NGC (or .EHC)
  1015.         file for each Ngo File name and will create the lines in the
  1016.         MAKENG.BAT file to compile them.
  1017.  
  1018.  
  1019.         B. NORTON GUIDE DATABASE LINK FILE CREATION
  1020.            DOC also creates a Norton Guide Database Link file with a
  1021.         default menu structure. This link file can be used as is, or the
  1022.         programmer can edit it with a text editor to change the menu
  1023.         wording or organization if desired before running the MAKENG
  1024.         batch file to compile and link the Norton Guide database.
  1025.  
  1026.           For example: if you have put references to the following Ngo-
  1027.         Files in your source code : ARRAY, BROWSE, COLOR, DATABASE,
  1028.         DISPLAY, DRIVPATH, MENU, PRINTER, STRING and you specified MISC
  1029.         as the default NgoFile, you have accepted NGO as the object file
  1030.         extension, and "My Personal Library" as the Long Name, then DOC
  1031.         will create the following link file:
  1032.  
  1033.              !name: My Personal Library
  1034.              !menu: Functions1
  1035.  
  1036.  
  1037.                                         17
  1038.  
  1039.  
  1040.  
  1041.                    ARRAY   ARRAY.NGO
  1042.                    BROWSE   BROWSE.NGO
  1043.                    COLOR    COLOR.NGO
  1044.                    DATABASE   DATABASE.NGO
  1045.                    DISPLAY   DISPLAY.NGO
  1046.              !menu: Functions2
  1047.                    DRIVPATH   DRIVPATH.NGO
  1048.                    MENU   MENU.NGO
  1049.                    MISC   MISC.NGO
  1050.                    PRINTER   PRINTER.NGO
  1051.                    STRING   STRING.NGO
  1052.  
  1053.         You must not change the object file names but you can rearrange
  1054.         the lines, change the !menu: names and the menu names for the
  1055.         object files.  For example you could make the following changes
  1056.         before running MAKENG.BAT.
  1057.  
  1058.              !name: My Personal Library
  1059.              !menu: User Interface
  1060.                    BROWSE      BROWSE.NGO
  1061.                    SCREEN COLOR  COLOR.NGO
  1062.                    DISPLAY     DISPLAY.NGO
  1063.                    MENU        MENU.NGO
  1064.              !menu: Array & DBF
  1065.                    ARRAY       ARRAY.NGO
  1066.                    DATABASE    DATABASE.NGO
  1067.              !menu: DOS, Print & Misc
  1068.                    DRIVE/PATH  DRIVPATH.NGO
  1069.                    MISC        MISC.NGO
  1070.                    PRINTER     PRINTER.NGO
  1071.                    STRING      STRING.NGO
  1072.  
  1073.  
  1074.         C. SEE ALSO REFERENCES
  1075.           When creating the Norton Guide Database entry for a function,
  1076.         if DOC finds one or more function names in the See Also section
  1077.         of the function header it creates a "See Also" or "Related Top-
  1078.         ics" reference from that entry to the specified other entries in
  1079.         the database.
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.                                         18
  1099.  
  1100.  
  1101.  
  1102.  
  1103.                                    CHAPTER VII
  1104.                            WRITE, GO and EXIT SubMenus
  1105.  
  1106.         A. WRITE SUBMENU
  1107.          1.) Read Configuration <F6>
  1108.         When you select this option DOC tries to read in a previously
  1109.         created Configuration File from the currently specified Source
  1110.         Code Directory.  If another name was not specified on the System
  1111.         Data Input Screen it looks for a file called "CONFIG.DOC".  If it
  1112.         finds the file it reads it in, over-writing any existing entries.
  1113.         The configuration data includes all user input including the data
  1114.         in the System Data screen, Output Data screen, Source Code File
  1115.         List and Key File List.
  1116.  
  1117.          2.) Write Configuration <F7>
  1118.         When you select this option DOC saves all the Configuration Data
  1119.         to a file in the current Source Code directory with the name
  1120.         "CONFIG.DOC" or other name as specified by the Configuration File
  1121.         name in System Data screen.  If you do not do this before telling
  1122.         DOC to "GO" (since it exits to DOS when it finishes documenting)
  1123.         or exiting DOC the configuration you created will be lost and you
  1124.         will have to recreate it if you ever want to document this par-
  1125.         ticular set of source code files again.
  1126.  
  1127.  
  1128.         B. GO SUBMENU
  1129.           Start Documenting <F9>
  1130.         When the F9 key is pressed DOC starts documenting the source code
  1131.         files in the Files To Be Documented List using the current set-
  1132.         tings.  You can abort by pressing the ESC key.
  1133.  
  1134.  
  1135.         C. EXIT SUBMENU
  1136.          1.) Go Back <Alt G>
  1137.         Go back to the Main Menu Screen.  Don't exit.
  1138.  
  1139.          2.) Quit <F10>
  1140.         Exits to DOS without documenting the source code.
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.                                         19
  1160.  
  1161.  
  1162.  
  1163.  
  1164.                                   CHAPTER VIII
  1165.                               THE SNAPCODE COMMENT
  1166.  
  1167.           Often in Clipper 5.0x code a function is called or a database
  1168.         or index is opened through a code block, macro or extended ex-
  1169.         pression rather than the explicit way that DOC understands.  In
  1170.         these cases DOC will not document the call, database or index.
  1171.         To get around this problem DOC allows the programmer to use a
  1172.         special comment that DOC will treat like code so that it will
  1173.         document things the way the programmer likes.  As a convience to
  1174.         people who have ever used both SNAP and DOC, the author of SNAP,
  1175.         Walter Kennamer (who is an all round dynamite fellow), suggested
  1176.         that DOC use the same syntax that SNAP uses for this purpose.
  1177.  
  1178.           In DOC a SNAPCODE comment is one that starts with * or // or &&
  1179.         (not a /* ... */ comment) and is not within a file or function
  1180.         header and the first word is SNAPCODE.  Whatever follows SNAPCODE
  1181.         is treated by DOC as if it were a regular code line.
  1182.  
  1183.         EXAMPLES OF SNAPCODE USE
  1184.  
  1185.              cDBFName := PickFromList()
  1186.              USE ( cDBFName )
  1187.              * SNAPCODE USE People
  1188.              * SNAPCODE USE Places
  1189.              * SNAPCODE USE Things
  1190.  
  1191.  
  1192.              bCodeBlock := iif( lSomething, {|| myfunc1() }, ;
  1193.                                             {|| myfunc2() } )
  1194.              AnotherFunc( bCodeBlock )
  1195.              .....
  1196.              ... < inside AnotherFunc() >
  1197.              EVAL( bCodeBlock )
  1198.              // SNAPCODE myfunc1(), myfunc2()
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.                                         20
  1221.