home *** CD-ROM | disk | FTP | other *** search
-
-
- (*******************************************************************)
- (* *)
- (* Include File *)
- (* System Line Entry, v. 0930am, sun, 28.Mar.87, Glen Ellis *)
- (* *)
- (*******************************************************************)
-
-
- (* included with the Core Program SYSTEM.PAS,
- (* as an auxillary module to be modified FOR each future application.
- (*
- (* purpose:
- (* accept command line parameters
- (*
- (* defaults are aimed a producing running + commented source code.
- (*
- (**)
-
- (*------------------------------------------------------*)
-
- BEGIN (* INCLUDE FILE *)
-
- IF paramcount > 0
- then
- begin
-
- (*---> #1 parameter *)
-
- SysInFilename := paramstr(1);
-
- writeln('-----------------------------------');
- writeln('SysLine FileName = ',SysInFileName);
-
- IF SysPgmTrace then pDelay1;
-
- (*------------------------------------------------------*)
- (* setup of global parms *)
-
- IF SysInFileName = '/F' then
- (* enable File Entry module *)
- (* gather no more command line parms *)
- begin
- (* enable the File Entry method : for FILE and PARMS *)
- SysCmdLine := false ; (* disable Line entry module *)
- SysCmdFile := true ; (* enable File entry module *)
- (**)
- SysCmdUser := true ; (* enable User Entry Module *)
- SysCmdUserFile := false ; (* not get filename *)
- SysCmdUserParm := true ; (* get parameters. *)
- end;
-
- If SysInFileName = '?' then
- (* enable User Entry module *)
- (* gather no more command line parms *)
- begin
- (* enable the User Entry method : for DOCS, FILE , PARMS *)
- SysCmdLine := false ; (* disable Line entry module *)
- SysCmdFile := false ; (* disable File entry module *)
- (**)
- SysCmdUser := true ; (* enable User Entry Module *)
- SysCmdUserFile := true ; (* not get filename *)
- SysCmdUserParm := true ; (* not get parameters *)
- end;
-
- (*--------------------------------------------------------------*)
- (* now, *)
- (* flags are set, and program continues for Command Line Entry *)
-
- IF SysCmdLine then
- begin (* continue to gather more parameters from command line *)
-
- (* single filename procedure *)
- (* to be followed via Line Entry method *)
- (* always defaults for looping through SysInSource[1.48] *)
- SysInSourceCnt := 0;
- SysInSourceMax := 1;
- SysInSource[SysInSourceMax] := SysInFilename;
-
-
- (*---> #2 parameter *) (* SysIndent *)
-
- IF length(paramstr(2)) > 0 then
- begin
- val(paramstr(2),SysIndentNum,xx);
- SysIndent := true ;
- end
- ELSE (* = 0 = missing *)
- begin (* default *)
- SysIndentNum := 3; (* safe default *)
- SysIndent := true; (* always do an indent ! *)
- end;
-
- SysIndentPos := 0; (* always *)
-
-
- (*---> #3 paramter *) (* SysComment *)
-
- IF length(paramstr(3)) > 0
- then
- begin (* normal *)
- val(paramstr(3),SysCommentNum,xx);
- (* parse selection entry *)
- IF SysCommentNum = 1 then (* normal *)
- begin
- SysComment := true;
- end
- ELSE (* SysCommentNum = 0 *)
- begin
- (* actively selected NO comment *)
- SysComment := false;
- end;
- end
- ELSE (* = 0 *) (* normal *)
- begin
- (* safe default always *)
- SysComment := true;
- end;
-
-
- (*---> #4 parameter *) (* SysLineCnt *) (* SysVertiate *)
-
- IF length(paramstr(4)) > 0
- then
- begin
- val(paramstr(4),SysLineCntnum,xx);
- IF SysLineCntNum = 1
- then
- begin
- SysLineCnt := true ;
- SysLenMax := 75;
- SysVertiate := true ;
- end
- ELSE (* = 0 *) (* normal *)
- begin
- SysLineCnt := false; (* no line count numbers *)
- SysLenMax := 79; (* page width *)
- SysVertiate := false; (* no vertical filler markers *)
- end;
- end
- ELSE (* length(paramstr(4)) = 0 = missing *)
- begin (* safe defaults always *)
- SysLineCnt := false; (* produce running source code file *)
- SysLenMax := 79; (* page widtth *)
- SysVertiate := false;(* not fill blank lines with comment mark *)
- end; (* #4 *)
-
-
- (*---> check list for default settings *)
-
- (* have parm(1)
- (* so : file.typ, #, #, # = 4
- (* parameter counter must = 4
- (* object for defaults : setup for writing running code
- (**)
-
- (* should have caught all parameters entry/default by now !
- (**)
-
- end; (* IF SysCmdLine *)
-
- end
- ELSE (* paramcount = 0 *)
- begin
-
- (* command line should contain all incoming data *)
- SysInFileName := '?'; (* enable Entry/Docs module *)
- SysCmdLine := false ; (* *)
- SysCmdFile := false ; (* disable File entry module *)
- SysCmdUser := true ; (* enable User Entry Module. *)
- SysCmdUserFile := true ; (* get filename from FIle *)
- SysCmdUserParm := true ; (* get parameters from File *)
-
- end;
-
-
- END; (* INCLUDE FILE *)
-
- (*******************************************************************)
-
- (*<<<>>>*)