home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / TURBOPAS / ZINDENT5.LBR / SYSLINE.IQC / SYSLINE.INC
Text File  |  2000-06-30  |  5KB  |  163 lines

  1.  
  2. (* Include **********************************************************)
  3. (* System Line Entry, v. 0630pm, wed, 17.Sep.86, Glen Ellis         *)
  4.  
  5. (* does not stand call !  introduces '.' expected on 'end;'
  6. (* procedure SYSLINE(InFileName : string14; IndentNum : nbr;
  7. (*    Comment,LineCnt : lgc;
  8. (*    LenMax,IndentPos,InSourceCnt,InSourceMax : nbr);
  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. (* function:
  18. (*    fetches infile, indent#, Comment, LineCnt from command line.
  19. (*    supplies defaults FOR indent#, Comment, LineCnt
  20. (*
  21. *)
  22.  
  23. (*------------------------------------------------------*)
  24.  
  25. BEGIN (* proc *)
  26.    
  27.    IF paramcount > 0 then
  28.    begin
  29.       
  30.       (*---> #1 parameter *)
  31.       
  32.       IF (length(paramstr(1)) > 0) then
  33.       SysInFilename   := paramstr(1);
  34.       writeln('-----------------------------------');
  35.       writeln('SysLine FileName = ',SysInFileName);
  36.       
  37.       IF SysPgmTrace then delay(1000);
  38.       
  39.       IF SysInFileName > '?' then
  40.       (* enable the User Entry method : for FILE and PARMS *)
  41.       (* this will skip SysFile and into SysUser *)
  42.       begin
  43.          SysCmdLine := true  ;    (* enable Line entry module *)
  44.          SysCmdFile := false ;
  45.          SysCmdUser := false ;     (* disable User entry module *)
  46.          SysCmdUserFile := false ; (* Not get filename *)
  47.          SysCmdUserParm := false ; (* Not get parameters *)
  48.       end
  49.       ELSE (* filename = "?" *)
  50.       begin
  51.          SysCmdLine := false ;    (* have valid filename entry *)
  52.          SysCmdFile := false ;    (* disable File entry module *)
  53.          SysCmdUser := true  ;    (* enable User entry module *)
  54.          (*SysCmdUserFile := true ; (* get filename only *)
  55.          (*SysCmdUserParm := true ; (* will install defaults *)
  56.       end;
  57.       
  58.       
  59.       (*=======================================================*)
  60.       IF SysCmdLine then (* continue to gather more parameters *)
  61.       begin
  62.          
  63.          (* single filename procedure *)
  64.          (* to be followed via Line Entry method *)
  65.          (* always defaults for looping through SysInSource[1.48] *)
  66.          SysInSourceCnt := 0;
  67.          SysInSourceMax := 1;
  68.          SysInSource[SysInSourceMax] := SysInFilename;
  69.          
  70.          
  71.          
  72.          (*---> #2 parameter *) (* SysIndent *)
  73.          
  74.          IF length(paramstr(2)) > 0 then
  75.          begin
  76.             val(paramstr(2),SysIndentNum,xx);
  77.             SysIndent := true ;
  78.          end
  79.          ELSE  (* length(paramstr(2)) = 0 = missing *)
  80.          begin
  81.             (* zero indent not allowed ! *)
  82.             SysIndentNum := 3;  (* safe default *)
  83.             SysIndent := true;  (* always do an indent ! *)
  84.          end;
  85.          
  86.          SysIndentPos := 0; (* always *)
  87.          
  88.          
  89.          
  90.          (*---> #3 paramter *) (* SysComment *)
  91.          
  92.          IF length(paramstr(3)) > 0 then
  93.          begin  (* normal *)
  94.             val(paramstr(3),SysCommentNum,xx);
  95.             IF SysCommentNum = 1 then  (* normal *)
  96.             SysComment := true
  97.             ELSE (* = 0 *)
  98.             SysComment := false; (* actively selected NO comment *)
  99.          end
  100.          ELSE  (* length(paramstr(3)) = 0 = missing *)
  101.          begin
  102.             SysComment := true ;  (* safe default always *)
  103.          end;
  104.          
  105.          
  106.          
  107.          (*---> #4 parameter *) (* SysLineCnt *) (* SysVertiate *)
  108.          
  109.          IF length(paramstr(4)) > 0 then
  110.          begin
  111.             val(paramstr(4),SysLineCntnum,xx);
  112.             IF SysLineCntNum = 1 then
  113.             begin
  114.                SysLineCnt := true ;
  115.                SysLenMax  := 75;
  116.                SysVertiate := true ;
  117.             end
  118.             ELSE  (* = 0 *)  (* normal *)
  119.             begin
  120.                SysLineCnt := false;  (* no line count numbers *)
  121.                SysLenMax  := 79;     (* page width *)
  122.                SysVertiate := false; (* no vertical filler markers *)
  123.             end;
  124.          end
  125.          ELSE  (* length(paramstr(4)) = 0 = missing *)
  126.          begin (* safe defaults always *)
  127.             SysLineCnt := false; (* produce running source code file *)
  128.             SysLenMax  := 79;    (* page widtth *)
  129.             SysVertiate := false;(* not fill blank lines with comment mark *)
  130.          end; (* #4 *)
  131.          
  132.          
  133.          
  134.          (*---> check list for default settings *)
  135.          
  136.          (* have parm(1)
  137.          (* so :   file.typ, #, #, #   = 4
  138.          (* parameter counter must = 4
  139.          (* object for defaults : setup for writing running code
  140.          *)
  141.          
  142.          (* should have caught all parameters entry/default by now ! *)
  143.          
  144.       end; (* IF SysCmdLine *)
  145.       
  146.    end
  147.    ELSE  (* paramcount = 0 *)
  148.    begin
  149.       SysCmdLine := false;
  150.    end;
  151.    
  152.    
  153. END;  (* proc *)
  154.  
  155. (********************************************************************)
  156. (*:B:0*)
  157. lse;
  158.    end;
  159.    
  160.    
  161. END;  (* proc *)
  162.  
  163. (******************************************************************