home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / OUT18.ZIP / OUTLINE.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1986-11-24  |  6.1 KB  |  182 lines

  1.  
  2. (*
  3.  * outline - a simple "outline" oriented document generator
  4.  *
  5.  * This program allows you to make an outline of the sections in
  6.  * a document, and then move around in the heirarchy to edit
  7.  * your document.   You can move whole sections of the document
  8.  * by simply moving the section title!
  9.  *
  10.  * Author:  Samuel H. Smith,  11-Jan-86
  11.  *
  12.  *
  13.  * Release history:
  14.  *
  15.  *   date      version             notes
  16.  * ---------   -------    ------------------------
  17.  *
  18.  * 11-jan-86     1.0      Initial release to public domain
  19.  *
  20.  * 12-jan-86     1.1      Added include files in section description.
  21.  *                        Added file directory in select-file.
  22.  *                        Speeded up some screens.  Cleaned up
  23.  *                        user interface and error handling.
  24.  *                        Added paragraph reformat in printing.
  25.  *
  26.  * 16-Jan-86     1.2      Added estimate calculation.  Added the
  27.  *                        ability to load old format OLF files.
  28.  *                        made function keys more consistant.
  29.  *
  30.  * 20-Jan-86     1.3      Added search paths for option file and load-files.
  31.  *                        Fixed bug in 0 estimates at top level.  Changed
  32.  *                        printout estimate to match display format.  Moves
  33.  *                        print procedures to a seperate include file.
  34.  *
  35.  * 06-Feb-86              Fixed a bug in reformat line that caused some lines
  36.  *                        to be truncated.
  37.  *
  38.  * 28-Feb-86     1.4      Made print handlers remove underlining and extra
  39.  *                        blank lines on empty subsections.  Removed summary
  40.  *                        from beginning of detail printout.  Added graphic
  41.  *                        picture include files.  Changed "print" directory
  42.  *                        to include *.PRN,*.SUM only.
  43.  *
  44.  * 29-Apr-86     1.5      Added tree print format.  Changes all printing to
  45.  *                        use the F4 key.   Added contents/outline format.
  46.  *                        Added keyword index format.  Fixed bugs related
  47.  *                        to moving sections.
  48.  *
  49.  * 14-Jul-86     1.6      Added -mono and -slowdisplay command line options.
  50.  *
  51.  * 29-Sep-86     1.7      Added .inc file reformatting.  Made outsplit version
  52.  *                        which splits up text into include files.
  53.  *                        Added automatic section numbers (dewey decimal).
  54.  *                        Added right justify to text blocks.
  55.  *
  56.  * 24-Nov-86     1.8      Added true underlining of  section titles.
  57.  *                        Added .ENHANCE and .NOENHANCE to control font.
  58.  *
  59.  *)
  60.  
  61.  
  62. {$C-     Do not check for ^C}
  63. {$D-     Buffer outputs for devices}
  64. {$R-     Disable subscript and variable rangechecks}
  65. {$V-     Enable variable length string parameters}
  66.  
  67.  
  68. program outline_processor (input, output, optionfd, savefd, printfd);
  69.  
  70. const
  71.    version = '        Document Outline Processor          v1.8 (24-Nov-86 SHS)';
  72.  
  73.  
  74. {$I \shs\tools\regpack.inc    Utility register package data type}
  75. {$I outdata.inc               Outline data declarations}
  76. {$I \shs\tools\popup.inc      Utility library for pop-up windows and quick displays}
  77. {$i \shs\tools\gettime.inc    Utility to get time of day from DOS}
  78. {$i \shs\tools\givetime.inc   Utility to give up time in doubledos}
  79. {$I outmisc.inc               Outline utility procedures}
  80. {$I \shs\tools\getfiles.inc   Utility library to get file directories}
  81. {$I \shs\tools\locfile.inc    Utility library to locate files with search paths}
  82. {$I outfiles.inc              Outline File Load/Save procedures}
  83. {$I outindex.inc              Outline Print index procedures}
  84. {$I outtree.inc               Outline Print tree procedures}
  85. {$I outgraph.inc              Outline Print graphics procedures}
  86. {$I outform.inc               Outline Print reformat text procedures}
  87. {$I outsect.inc               Outline Print sections procedures}
  88. {$I outprint.inc              Outline Print procedures}
  89. {$I outedit.inc               Outline Editing procedures}
  90. {$I outinit.inc               Outline initialization}
  91.  
  92.  
  93. (*
  94.  * main program - give main menu and select main handler procedures
  95.  *
  96.  *)
  97.  
  98. var
  99.    key:  char;
  100.  
  101. begin {main}
  102.  
  103.    initialize;
  104.  
  105.    repeat
  106.       normvideo;
  107.       clrscr;
  108.       lowvideo; displn(version); writeln;
  109.       normvideo;
  110.       displn('                       M A I N     M E N U');
  111.       writeln;
  112.       displn('            Key                 Action'); lowvideo;
  113.       displn('           ═════    ═════════════════════════════');
  114.       writeln;
  115.       displn('             F1     Work on the current outline');
  116.       writeln;
  117.       displn('             F2     Retrieve an outline from disk');
  118.       writeln;
  119.       displn('             F3     Save the outline on disk');
  120.       writeln;
  121.       displn('             F4     Print the document');
  122.       writeln;
  123.       displn('             F5     Change the working directory');
  124.       writeln;
  125.       displn('             F6     Delete the current outline from memory');
  126.       writeln;
  127.       disp  ('             F10    Exit to DOS');
  128.  
  129.       gotoxy(74,25);
  130.       write(maxavail shr 6,'k');
  131.       if not saved then
  132.          disp (' *');
  133.  
  134.       normvideo;
  135.       gotoxy(1,24);
  136.       write  ('        Select function: ');
  137.  
  138.       repeat
  139.          key := getkey;
  140.          if not (key in [F1..F6,F10,PGDN]) then
  141.             write(^G);
  142.  
  143.       until key in [F1..F10,PGDN];
  144.       clrscr;
  145.  
  146.       case key of
  147.  
  148.          PGDN,
  149.          F1:   edit_section(document,docfile,'');
  150.  
  151.          F2:   load_document;
  152.  
  153.          F3:   save_document;
  154.  
  155.          F4:   print_document(document,1,'');
  156.  
  157.          F5:   change_dir;
  158.  
  159.          F6:   begin
  160.                   save_if_needed;
  161.                   if delsec <> nil then
  162.                      delete_section(delsec);
  163.                   delsec := nil;
  164.                   delete_section(document);
  165.                   document := new_section;
  166.                end;
  167.  
  168.          F10:  ;
  169.  
  170.          else  write(^G);
  171.       end;
  172.  
  173.    until key = F10;
  174.  
  175.    save_if_needed;
  176.  
  177.    clrscr;
  178.    displn('Thank you for using OUTLINE!');
  179.  
  180. end.
  181.  
  182.