(* Include **********************************************************) (* System Line Entry, v. 0630pm, wed, 17.Sep.86, Glen Ellis *) (* does not stand call ! introduces '.' expected on 'end;' (* procedure SYSLINE(InFileName : string14; IndentNum : nbr; (* Comment,LineCnt : lgc; (* LenMax,IndentPos,InSourceCnt,InSourceMax : nbr); *) (* included with the Core Program SYSTEM.PAS, (* as an auxillary module to be modified FOR each future application. (* (* purpose: (* accept command line parameters (* (* function: (* fetches infile, indent#, Comment, LineCnt from command line. (* supplies defaults FOR indent#, Comment, LineCnt (* *) (*------------------------------------------------------*) BEGIN (* proc *) IF paramcount > 0 then begin (*---> #1 parameter *) IF (length(paramstr(1)) > 0) then SysInFilename := paramstr(1); writeln('-----------------------------------'); writeln('SysLine FileName = ',SysInFileName); IF SysPgmTrace then delay(1000); IF SysInFileName > '?' then (* enable the User Entry method : for FILE and PARMS *) (* this will skip SysFile and into SysUser *) begin SysCmdLine := true ; (* enable Line entry module *) SysCmdFile := false ; SysCmdUser := false ; (* disable User entry module *) SysCmdUserFile := false ; (* Not get filename *) SysCmdUserParm := false ; (* Not get parameters *) end ELSE (* filename = "?" *) begin SysCmdLine := false ; (* have valid filename entry *) SysCmdFile := false ; (* disable File entry module *) SysCmdUser := true ; (* enable User entry module *) (*SysCmdUserFile := true ; (* get filename only *) (*SysCmdUserParm := true ; (* will install defaults *) end; (*=======================================================*) IF SysCmdLine then (* continue to gather more parameters *) begin (* 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 (* length(paramstr(2)) = 0 = missing *) begin (* zero indent not allowed ! *) 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); IF SysCommentNum = 1 then (* normal *) SysComment := true ELSE (* = 0 *) SysComment := false; (* actively selected NO comment *) end ELSE (* length(paramstr(3)) = 0 = missing *) begin SysComment := true ; (* safe default always *) 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 SysCmdLine := false; end; END; (* proc *) (********************************************************************) (*:B:0*)