home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / PROG / DOC303.ZIP / DOC.MAN < prev    next >
Encoding:
Text File  |  1993-06-04  |  43.5 KB  |  1,221 lines

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