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

  1.  
  2.  
  3. (***********************************************************)
  4. (* Include File                                            *)
  5. (* System Utility,   v. 0600am, fri, 27.Mar.87, Glen Ellis *)
  6. (***********************************************************)
  7.  
  8.  
  9. (* procedure ****************************************************)
  10.  
  11. procedure pALARM;
  12.  
  13. var  x : integer;
  14. begin
  15.    for x := 1 to 3
  16.       do write(chr(7));
  17. end;
  18.  
  19.  
  20. (*==============================================================*)
  21. (* System Variable Handling Procedures *)
  22.  
  23. (* Procedure ******************************************************)
  24. (* System Var Initialize,   v. 0500am, sat, 06.Sep.86, Glen Ellis *)
  25.  
  26. procedure  pSysInitz;  (* uses globals *)
  27.  
  28. begin  (* proc *)
  29.    SysCmdLine := false;
  30.    SysCmdFile := false;
  31.    SysCmdUser := false;
  32.    SysInFilename  := ' ';
  33.    SysInSource[1] := ' ';
  34.    SysEnableBegin := false;
  35.    SysLineCnt     := false;
  36.    SysIndentNum   := 0;
  37.    SysIndentPos   := 0;
  38.    SysLenMax      := 0;
  39.    SysComment := true;
  40.    SysLineCnt := false;
  41.    SysVertiate := false;
  42.    SysInSourceCnt := 0;
  43.    SysInSourceMax := 0;
  44. end;  (* proc *)
  45.  
  46.  
  47. (* procedure ******************************************************)
  48. (* SysLvlInit,   v. 1244pm, sun, 31.Aug.86, Glen Ellis            *)
  49.  
  50. procedure pSysLvlInit;
  51.  
  52. begin (* P *)
  53.    (* required for KEYWORD.INC *)
  54.    (* fresh for each file being parsed *)
  55.    (* not all used in any one application *)
  56.    (* rename these if need be, assign in SYSTEM.VAR *)
  57.    (* long memvar names used for programming readability  *)
  58.    (* short memvar names used for passing parms to procedures *)
  59.    SysEnableBegin := false; (* flag for first 'begin' *)
  60.    SEB            := false;
  61.    SysLevelIf     := 0;
  62.    SLI       := 0;
  63.    SysLevelCase   := 0;
  64.    SLC       := 0;
  65.    SysLevelWhile  := 0;
  66.    SLW       := 0;
  67.    SysLevelBegin  := 0;
  68.    SLB       := 0;
  69.    SysLevelRepeat := 0;
  70.    SLR       := 0;
  71. end; (* P *)
  72.  
  73.  
  74.  
  75. (* procedure ******************************************************)
  76. (* Sys Var Short Update, v. 0600am, wed, 17.Sep.86, Glen Ellis  *)
  77.  
  78. procedure pSysVarShortUpdt;
  79.  
  80. begin (* P *)
  81.    (* update short named level from long named level vars *)
  82.    (* required for KEYWORD.INC *)
  83.    (* fresh for each file being parsed *)
  84.    (* not all used in any one application *)
  85.    (* rename these if need be, assign in SYSTEM.VAR *)
  86.    SOLL := SysOutLine;
  87.    SIP  := SysIndentPos;
  88.    SIN  := SysIndentNum;
  89.    SLM  := SysLenMax;
  90.    SMW  := SysMarkWrite;
  91.    SEB  := SysEnableBegin;
  92.    SLI  := SysLevelIF;
  93.    SLC  := SysLevelCASE;
  94.    SLW  := SysLevelWHILE;
  95.    SLB  := SysLevelBEGIN;
  96.    SLR  := SysLevelREPEAT;
  97. end; (*proc*)
  98.  
  99.  
  100.  
  101. (* procedure ******************************************************)
  102. (* Sys Var Long UPDate,   v. 0600am, wed, 17.Sep.86, Glen Ellis *)
  103.  
  104. procedure pSysVarLongUpdt;
  105.  
  106. begin (*proc*)
  107.    (* Downdate short named level into long named level vars *)
  108.    (* required for KEYWORD.INC *)
  109.    (* fresh for each file being parsed *)
  110.    (* not all used in any one application *)
  111.    (* rename these if need be, assign in SYSTEM.VAR *)
  112.    SysOutLine := SOLL;
  113.    SysIndentPos := SIP;
  114.    SysIndentNum := SIN;
  115.    SysLenMax := SLM;
  116.    SysMarkWrite := SMW;
  117.    SysEnableBegin := SEB;
  118.    SysLevelIF := SLI;
  119.    SysLevelCASE := SLC;
  120.    SysLevelWHILE := SLW;
  121.    SysLevelBEGIN := SLB;
  122.    SysLevelREPEAT := SLR;
  123. end; (*proc*)
  124.  
  125.  
  126.  
  127. (* procedure ****************************************************)
  128. (* Say System Variables, v. 0900am, sat, 20.Sep.86, Glen Ellis  *)
  129.  
  130. procedure pSaySysVar;
  131.  
  132. var
  133. line : Thestr;
  134. cmdline, cmdfile, cmduser : string7 ;
  135. comment, linecnt, vertiate : string7;
  136. indentnum, indentpos, lenmax, insourcecnt, insourcemax : string7;
  137.  
  138. begin (* P *)
  139.    (* BIG display prior to CORE *)
  140.    (* pause for preceding display of filename list *)
  141.    pDelay4;
  142.    (* operating parameters *)
  143.    FOR x := 1 to 23
  144.       do writeln; (* Apple/CPM clear screen *)
  145.    begin (* say sys var *)
  146.       line := 'A: SysUtl.inc, pSaySysVar : OPERATING variables';
  147.       pSayLnCJ(line,80);
  148.       line := 'Parameter Source Control variables';
  149.       pSayLnCJ(line,80);
  150.       IF SysCmdLine then cmdline:='true' else cmdline:= 'false';
  151.       IF SysCmdFile then cmdfile:='true' else cmdfile:= 'false';
  152.       IF SysCmdUser then cmduser:='true' else cmduser:= 'false';
  153.       line := 'L='+cmdline+' : F='+cmdfile+' : U='+cmduser ;
  154.       pSayLnCJ(line,80);
  155.       line := 'SysInFileName = ' + SysInFileName;
  156.       pSayLnCJ(line,80);
  157.       IF SysComment  then comment  :='true' else comment  := 'false';
  158.       IF SysLineCnt  then linecnt  :='true' else linecnt  := 'false';
  159.       IF SysVertiate then vertiate :='true' else vertiate := 'false';
  160.       writeln;
  161.       line := 'SysComment     = ' + comment;
  162.       pSayLnCJ(line,80);
  163.       line := 'SysLineCNT     = ' + linecnt;
  164.       pSayLnCJ(line,80);
  165.       line := 'SysVertiate    = ' + vertiate;
  166.       pSayLnCJ(line,80);
  167.       str(SysIndentNum,indentnum);
  168.       str(SysIndentPos,indentpos);
  169.       str(SysLenMax   ,lenmax   );
  170.       line :=
  171.       'SysIndentNUM = ' + indentnum +
  172.       ' : SysIndentPOS = ' + indentpos +
  173.       ' : SysLineMAX   = ' + lenmax;
  174.       pSayLnCJ(line,80);
  175.       str(SysInSourceCnt,insourcecnt);
  176.       str(SysInSourceMax,insourcemax);
  177.       line :=
  178.       'SysInSourceCNT = ' + insourcecnt +
  179.       ' : SysInsourceMAX = ' + insourcemax;
  180.       pSayLnCJ(line,80);
  181.       line := 'SysPgmMod      = ' + SysPgmMod;
  182.       pSayLnCJ(line,80);
  183.       line := '<CR> continue, <ESC> halt';
  184.       pSayLnCJ(line,80);
  185.       pReadCR;
  186.       (* wait for programmer; takes time to read this display *)
  187.    end; (* say sys var *)
  188.  
  189. end; (*proc*)
  190.  
  191.  
  192.  
  193. (* procedure ***********************************************)
  194. (* System Filenames, v. 0719am, sun, 31.Aug.86, Glen Ellis    *)
  195.  
  196. procedure pSaySysFiles;
  197.  
  198. begin(* P *)
  199.    writeln;
  200.    writeln('SysPgmMod = ',SysPgmMod);
  201.    writeln('     file.BAK  = ',SysFile0);
  202.    writeln('SysInFilename  = ',SysFile1);
  203.    writeln('     file.$$$  = ',SysFile2);
  204.    writeln;
  205. end; (* P *)
  206.  
  207.  
  208.  
  209. (* procedure ***************************************************)
  210. (* SYStem LeVeL Write , v. 0734am, sun, 31.Aug.86, Glen Ellis  *)
  211.  
  212. procedure pSysLvlWrite;
  213.  
  214. begin (* P *)
  215.    (* uses system vars *)
  216.    pSysVarShortUpdt;
  217.    IF SysComment then
  218.    begin
  219.       (**)
  220.       (* Displays Count of Keyword Actions : (shift right - shift left ) *)
  221.       (* very useful for debugging *)
  222.       (* has been usefully attached to end of output files. *)
  223.       (**)
  224.       (* dBASE has three distinct forms *)
  225.       IF SysPgmMod = 'DB' then
  226.       writeln(SysOutFile,SPMSL,':I:',SLI,'   :C:',SLC,'   :W:',SLW,SPMSR);
  227.       (**)
  228.       (* Pascal can be simplified to one form *)
  229.       IF SysPgmMod = 'TP' then
  230.       writeln(SysOutFile,SPMSL,':B:',SLB,SPMSR);
  231.       (**)
  232.    end;
  233. end; (*proc*)
  234.  
  235.  
  236. (***********************************************************************)
  237. (*<<<>>>*)