home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / OUT18.ZIP / OUTSPLIT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1986-10-01  |  5.7 KB  |  174 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.  *)
  52.  
  53.  
  54. {$C-     Do not check for ^C}
  55. {$D-     Buffer outputs for devices}
  56. {$R-     Disable subscript and variable rangechecks}
  57. {$V-     Enable variable length string parameters}
  58.  
  59.  
  60. program outline_processor (input, output, optionfd, savefd, printfd);
  61.  
  62. const
  63.    version = '        Document Outline Processor          v1.6 (14-Jul-86 SHS)';
  64.  
  65.  
  66. {$I \shs\tools\regpack.inc    Utility register package data type}
  67. {$I outdata.inc               Outline data declarations}
  68. {$I \shs\tools\popup.inc      Utility library for pop-up windows and quick displays}
  69. {$i \shs\tools\gettime.inc    Utility to get time of day from DOS}
  70. {$i \shs\tools\givetime.inc   Utility to give up time in doubledos}
  71. {$I outmisc.inc               Outline utility procedures}
  72. {$I \shs\tools\getfiles.inc   Utility library to get file directories}
  73. {$I \shs\tools\locfile.inc    Utility library to locate files with search paths}
  74. {$I outfilex.inc              Outline File Load/Save procedures}
  75. {$I outindex.inc              Outline Print index procedures}
  76. {$I outtree.inc               Outline Print tree procedures}
  77. {$I outgraph.inc              Outline Print graphics procedures}
  78. {$I outform.inc               Outline Print reformat text procedures}
  79. {$I outsect.inc               Outline Print sections procedures}
  80. {$I outprint.inc              Outline Print procedures}
  81. {$I outedit.inc               Outline Editing procedures}
  82. {$I outinit.inc               Outline initialization}
  83.  
  84.  
  85. (*
  86.  * main program - give main menu and select main handler procedures
  87.  *
  88.  *)
  89.  
  90. var
  91.    key:  char;
  92.  
  93. begin {main}
  94.  
  95.    initialize;
  96.  
  97.    repeat
  98.       normvideo;
  99.       clrscr;
  100.       lowvideo; displn(version); writeln;
  101.       normvideo;
  102.       displn('                       M A I N     M E N U');
  103.       writeln;
  104.       displn('            Key                 Action'); lowvideo;
  105.       displn('           ═════    ═════════════════════════════');
  106.       writeln;
  107.       displn('             F1     Work on the current outline');
  108.       writeln;
  109.       displn('             F2     Retrieve an outline from disk');
  110.       writeln;
  111.       displn('             F3     Save the outline on disk');
  112.       writeln;
  113.       displn('             F4     Print the document');
  114.       writeln;
  115.       displn('             F5     Change the working directory');
  116.       writeln;
  117.       displn('             F6     Delete the current outline from memory');
  118.       writeln;
  119.       disp  ('             F10    Exit to DOS');
  120.  
  121.       gotoxy(74,25);
  122.       write(maxavail shr 6,'k');
  123.       if not saved then
  124.          disp (' *');
  125.  
  126.       normvideo;
  127.       gotoxy(1,24);
  128.       write  ('        Select function: ');
  129.  
  130.       repeat
  131.          key := getkey;
  132.          if not (key in [F1..F6,F10,PGDN]) then
  133.             write(^G);
  134.  
  135.       until key in [F1..F10,PGDN];
  136.       clrscr;
  137.  
  138.       case key of
  139.  
  140.          PGDN,
  141.          F1:   edit_section(document,docfile);
  142.  
  143.          F2:   load_document;
  144.  
  145.          F3:   save_document;
  146.  
  147.          F4:   print_document(document,1);
  148.  
  149.          F5:   change_dir;
  150.  
  151.          F6:   begin
  152.                   save_if_needed;
  153.                   if delsec <> nil then
  154.                      delete_section(delsec);
  155.                   delsec := nil;
  156.                   delete_section(document);
  157.                   document := new_section;
  158.                end;
  159.  
  160.          F10:  ;
  161.  
  162.          else  write(^G);
  163.       end;
  164.  
  165.    until key = F10;
  166.  
  167.    save_if_needed;
  168.  
  169.    clrscr;
  170.    displn('Thank you for using OUTLINE!');
  171.  
  172. end.
  173.  
  174.