home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / zen / zindent / zinline.inc < prev    next >
Encoding:
Text File  |  1987-03-30  |  6.1 KB  |  181 lines

  1.  
  2.  
  3. (*******************************************************************)
  4. (*                                                                 *)
  5. (* Include File                                                    *)
  6. (* System Line Entry, v. 0930am, sun, 28.Mar.87, Glen Ellis        *)
  7. (*                                                                 *)
  8. (*******************************************************************)
  9.  
  10.  
  11. (* included with the Core Program SYSTEM.PAS,
  12. (* as an auxillary module to be modified FOR each future application.
  13. (*
  14. (* purpose:
  15. (*     accept command line parameters
  16. (*
  17. (* defaults are aimed a producing running + commented source code.
  18. (*
  19. (**)
  20.  
  21. (*------------------------------------------------------*)
  22.  
  23. BEGIN (* INCLUDE FILE *)
  24.  
  25.    IF paramcount > 0
  26.    then
  27.    begin
  28.  
  29.       (*---> #1 parameter *)
  30.  
  31.       SysInFilename   := paramstr(1);
  32.  
  33.       writeln('-----------------------------------');
  34.       writeln('SysLine FileName = ',SysInFileName);
  35.  
  36.       IF SysPgmTrace then pDelay1;
  37.  
  38.       (*------------------------------------------------------*)
  39.       (*        setup of global parms                         *)
  40.  
  41.       IF SysInFileName = '/F' then
  42.       (* enable File Entry module *)
  43.       (* gather no more command line parms *)
  44.       begin
  45.          (* enable the File Entry method : for FILE and PARMS *)
  46.          SysCmdLine := false ;     (* disable Line entry module *)
  47.          SysCmdFile := true  ;     (* enable  File entry module *)
  48.          (**)
  49.          SysCmdUser := true  ;     (* enable User Entry Module *)
  50.          SysCmdUserFile := false ; (* not get filename *)
  51.          SysCmdUserParm := true  ; (*     get parameters.       *)
  52.       end;
  53.  
  54.       If SysInFileName = '?' then
  55.       (* enable User Entry module *)
  56.       (* gather no more command line parms *)
  57.       begin
  58.          (* enable the User Entry method : for DOCS, FILE , PARMS *)
  59.          SysCmdLine := false ;    (* disable Line entry module *)
  60.          SysCmdFile := false ;    (* disable File entry module *)
  61.          (**)
  62.          SysCmdUser := true  ;    (* enable User Entry Module *)
  63.          SysCmdUserFile := true ; (* not get filename *)
  64.          SysCmdUserParm := true ; (* not get parameters *)
  65.       end;
  66.  
  67.       (*--------------------------------------------------------------*)
  68.       (*  now,                                                        *)
  69.       (*  flags are set, and program continues for Command Line Entry *)
  70.       
  71.       IF SysCmdLine then
  72.       begin (* continue to gather more parameters from command line *)
  73.          
  74.          (* single filename procedure *)
  75.          (* to be followed via Line Entry method *)
  76.          (* always defaults for looping through SysInSource[1.48] *)
  77.          SysInSourceCnt := 0;
  78.          SysInSourceMax := 1;
  79.          SysInSource[SysInSourceMax] := SysInFilename;
  80.          
  81.          
  82.          (*---> #2 parameter *) (* SysIndent *)
  83.          
  84.          IF length(paramstr(2)) > 0 then
  85.          begin
  86.             val(paramstr(2),SysIndentNum,xx);
  87.             SysIndent := true ;
  88.          end
  89.          ELSE  (* = 0 = missing *)
  90.          begin (* default *)
  91.             SysIndentNum := 3;  (* safe default *)
  92.             SysIndent := true;  (* always do an indent ! *)
  93.          end;
  94.  
  95.          SysIndentPos := 0; (* always *)
  96.          
  97.          
  98.          (*---> #3 paramter *) (* SysComment *)
  99.          
  100.          IF length(paramstr(3)) > 0
  101.          then
  102.          begin  (* normal *)
  103.             val(paramstr(3),SysCommentNum,xx);
  104.             (* parse selection entry *)
  105.             IF SysCommentNum = 1 then  (* normal *)
  106.             begin
  107.                SysComment := true;
  108.             end
  109.             ELSE (* SysCommentNum = 0 *)
  110.             begin
  111.                (* actively selected NO comment *)
  112.                SysComment := false;
  113.             end;
  114.          end
  115.          ELSE  (* = 0 *) (* normal *)
  116.          begin
  117.             (* safe default always *)
  118.             SysComment := true;
  119.          end;
  120.          
  121.          
  122.          (*---> #4 parameter *) (* SysLineCnt *) (* SysVertiate *)
  123.          
  124.          IF length(paramstr(4)) > 0
  125.          then
  126.          begin
  127.             val(paramstr(4),SysLineCntnum,xx);
  128.             IF SysLineCntNum = 1
  129.             then
  130.             begin
  131.                SysLineCnt := true ;
  132.                SysLenMax  := 75;
  133.                SysVertiate := true ;
  134.             end
  135.             ELSE  (* = 0 *)  (* normal *)
  136.             begin
  137.                SysLineCnt := false;  (* no line count numbers *)
  138.                SysLenMax  := 79;     (* page width *)
  139.                SysVertiate := false; (* no vertical filler markers *)
  140.             end;
  141.          end
  142.          ELSE  (* length(paramstr(4)) = 0 = missing *)
  143.          begin (* safe defaults always *)
  144.             SysLineCnt := false; (* produce running source code file *)
  145.             SysLenMax  := 79;    (* page widtth *)
  146.             SysVertiate := false;(* not fill blank lines with comment mark *)
  147.          end; (* #4 *)
  148.          
  149.          
  150.          (*---> check list for default settings *)
  151.          
  152.          (* have parm(1)
  153.          (* so :   file.typ, #, #, #   = 4
  154.          (* parameter counter must = 4
  155.          (* object for defaults : setup for writing running code
  156.          (**)
  157.          
  158.          (* should have caught all parameters entry/default by now !
  159.          (**)
  160.          
  161.       end; (* IF SysCmdLine *)
  162.       
  163.    end
  164.    ELSE  (* paramcount = 0 *)
  165.    begin
  166.  
  167.       (* command line should contain all incoming data *)
  168.       SysInFileName := '?';     (* enable Entry/Docs module *)
  169.       SysCmdLine := false ;     (*                           *)
  170.       SysCmdFile := false ;     (* disable File entry module *)
  171.       SysCmdUser := true  ;     (* enable  User Entry Module. *)
  172.       SysCmdUserFile := true  ; (*     get filename   from FIle *)
  173.       SysCmdUserParm := true  ; (*     get parameters from File *)
  174.  
  175.    end;
  176.  
  177.  
  178. END;  (* INCLUDE FILE *)
  179.  
  180. (*******************************************************************)
  181.  
  182. (*<<<>>>*)