TIMING.LST 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. Listing:
  2. 1 IMPLEMENTATION MODULE Timing;
  3. 2 (*
  4. 3 * REPERTOIRE
  5. 4 * Release 1.6
  6. 5 * By Charles Bradford and Cole Brecheen
  7. 6 * (c) Copyright 1985-1992 PMI
  8. 7 * Green Bay, Wisconsin
  9. 8 * All rights reserved
  10. 9 * (414) 468-6040
  11. 10 *
  12. 11 * $Header: D:/logfiles/mods/timing.mov 1.7 10 Mar 1991 15:34:00 coleb $
  13. 12 *
  14. 13 *)
  15. 14
  16. 15
  17. 16 (*EntryDiag:
  18. 17 IMPORT Diagnostics;
  19. 18 :EntryDiag*)
  20. 19
  21. 20 IMPORT EnvironUtils;
  22. 21 IMPORT M2Strings;
  23. 22 IMPORT StrConv;
  24. 23 IMPORT StrEdit;
  25. 24 IMPORT SYSTEM;
  26. 25 IMPORT VWindows;
  27. 26
  28. 27 VAR
  29. 28 Initialized : BOOLEAN;
  30. 29
  31. 30 PROCEDURE Init();
  32. 31 BEGIN
  33. 32 IF Initialized THEN
  34. 33 RETURN;
  35. 34 ELSE
  36. 35 Initialized := TRUE;
  37. 36 END;
  38. 37 (*EntryDiag:
  39. 38 Diagnostics.Init();
  40. 39 :EntryDiag*)
  41. 40
  42. 41 EnvironUtils.Init();
  43. ***** ^ not supported yet
  44. ***** ^ not supported yet
  45. ***** ^ not supported yet
  46. 42 M2Strings.Init();
  47. ***** ^ not supported yet
  48. ***** ^ not supported yet
  49. ***** ^ not supported yet
  50. 43 StrConv.Init();
  51. ***** ^ not supported yet
  52. ***** ^ not supported yet
  53. ***** ^ not supported yet
  54. 44 StrEdit.Init();
  55. ***** ^ not supported yet
  56. ***** ^ not supported yet
  57. ***** ^ not supported yet
  58. 45 VWindows.Init();
  59. ***** ^ not supported yet
  60. ***** ^ not supported yet
  61. ***** ^ not supported yet
  62. 46
  63. 47 (*EntryDiag:
  64. 48 Diagnostics.diagS( 'Entering Timing', '' );
  65. 49 :EntryDiag*)
  66. 50
  67. 51 BeginTimer();
  68. ***** ^ undeclared identifier
  69. ***** ^ not supported yet
  70. 52
  71. 53 (*EntryDiag:
  72. 54 Diagnostics.diagS( 'Exiting Timing', '' );
  73. 55 :EntryDiag*)
  74. 56 END Init;
  75. ***** ^ not supported yet
  76. 57
  77. 58
  78. 59 VAR
  79. 60 hours, minutes, seconds, hunds : CARDINAL;
  80. 61
  81. 62 PROCEDURE BeginTimer();
  82. 63 VAR
  83. 64 dumstr : ARRAY [0..80] OF CHAR;
  84. ***** ^ not supported yet
  85. ***** ^ not supported yet
  86. 65 BEGIN
  87. 66 EnvironUtils.GetTime(hours, minutes, seconds, hunds, dumstr);
  88. ***** ^ not supported yet
  89. ***** ^ not supported yet
  90. ***** ^ not supported yet
  91. 67 END BeginTimer;
  92. ***** ^ not supported yet
  93. 68
  94. 69 PROCEDURE ReadTimer(VAR hout, mout, sout, hunout : CARDINAL);
  95. 70 VAR
  96. 71 dumstr : ARRAY [0..20] OF CHAR;
  97. ***** ^ not supported yet
  98. ***** ^ not supported yet
  99. 72 hused, mused, sused, hunused : INTEGER;
  100. 73 BEGIN
  101. 74 EnvironUtils.GetTime(hout, mout, sout, hunout, dumstr);
  102. ***** ^ not supported yet
  103. ***** ^ not supported yet
  104. ***** ^ not supported yet
  105. 75 hunused := INTEGER(hunout)-INTEGER(hunds);
  106. ***** ^ not supported yet
  107. ***** ^ not supported yet
  108. 76 sused := INTEGER(sout)-INTEGER(seconds);
  109. ***** ^ not supported yet
  110. ***** ^ not supported yet
  111. 77 mused := INTEGER(mout)-INTEGER(minutes);
  112. ***** ^ not supported yet
  113. ***** ^ not supported yet
  114. 78 hused := INTEGER(hout)-INTEGER(hours);
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. 79 IF hunused<0 THEN
  118. 80 INC( hunused, 100);
  119. ***** ^ undeclared identifier
  120. ***** ^ not supported yet
  121. 81 DEC( sused);
  122. ***** ^ undeclared identifier
  123. ***** ^ not supported yet
  124. 82 END;
  125. 83 IF sused<0 THEN
  126. 84 INC( sused, 60);
  127. ***** ^ undeclared identifier
  128. ***** ^ not supported yet
  129. 85 DEC( mused);
  130. ***** ^ undeclared identifier
  131. ***** ^ not supported yet
  132. 86 END;
  133. 87 IF mused<0 THEN
  134. 88 INC( mused, 60);
  135. ***** ^ undeclared identifier
  136. ***** ^ not supported yet
  137. 89 DEC( hused);
  138. ***** ^ undeclared identifier
  139. ***** ^ not supported yet
  140. 90 END;
  141. 91 IF hused<0 THEN
  142. 92 (* accounts for use through midnight; but does not
  143. 93 handle use for longer than 24 hours *)
  144. 94 INC( hused, 24);
  145. ***** ^ undeclared identifier
  146. ***** ^ not supported yet
  147. 95 END;
  148. 96 hunout := hunused;
  149. 97 sout := sused;
  150. 98 hout := hused;
  151. 99 mout := mused;
  152. 100 END ReadTimer;
  153. ***** ^ not supported yet
  154. 101
  155. 102 PROCEDURE ShowUsage(name : ARRAY OF CHAR);
  156. ***** ^ not supported yet
  157. 103 VAR
  158. 104 h, m, s, hun : CARDINAL;
  159. 105 dumstr : ARRAY [0..255] OF CHAR;
  160. ***** ^ not supported yet
  161. ***** ^ not supported yet
  162. 106 numstr : ARRAY [0..10] OF CHAR;
  163. ***** ^ not supported yet
  164. ***** ^ not supported yet
  165. 107 caption : ARRAY [0..31] OF CHAR;
  166. ***** ^ not supported yet
  167. ***** ^ not supported yet
  168. 108 dumc : CARDINAL;
  169. 109 BEGIN
  170. 110 ReadTimer(h, m, s, hun);
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. 111 M2Strings.Concat('You have been using ', name, dumstr);
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. ***** ^ not supported yet
  179. 112 StrEdit.Append(dumstr, ' for ');
  180. ***** ^ not supported yet
  181. ***** ^ not supported yet
  182. ***** ^ not supported yet
  183. ***** ^ not supported yet
  184. 113 StrConv.CardinalToStr(h*60+m, 1, numstr);
  185. ***** ^ not supported yet
  186. ***** ^ not supported yet
  187. ***** ^ not supported yet
  188. 114 StrEdit.Append(dumstr, numstr);
  189. ***** ^ not supported yet
  190. ***** ^ not supported yet
  191. ***** ^ not supported yet
  192. ***** ^ not supported yet
  193. 115 StrEdit.Append(dumstr, ' minute');
  194. ***** ^ not supported yet
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. 116 IF h+h+m#1 THEN
  199. 117 StrEdit.Append(dumstr, 's');
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. 118 END;
  205. 119 StrEdit.Append(dumstr, ' and ');
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. ***** ^ not supported yet
  210. 120 StrConv.CardinalToStr(s, 1, numstr);
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. 121 StrEdit.Append(dumstr, numstr);
  215. ***** ^ not supported yet
  216. ***** ^ not supported yet
  217. ***** ^ not supported yet
  218. ***** ^ not supported yet
  219. 122 StrEdit.Append(dumstr, ' second');
  220. ***** ^ not supported yet
  221. ***** ^ not supported yet
  222. ***** ^ not supported yet
  223. ***** ^ not supported yet
  224. 123 IF s#1 THEN
  225. 124 StrEdit.Append(dumstr, 's');
  226. ***** ^ not supported yet
  227. ***** ^ not supported yet
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. 125 END;
  231. 126 StrEdit.Append(dumstr, ' in this session.');
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. ***** ^ not supported yet
  235. ***** ^ not supported yet
  236. 127 caption := 'Elapsed Time';
  237. ***** ^ not supported yet
  238. ***** ^ not supported yet
  239. 128 dumc := VWindows.MessageBox( VWindows.CurrentWindow,
  240. ***** ^ not supported yet
  241. ***** ^ not supported yet
  242. ***** ^ not supported yet
  243. ***** ^ not supported yet
  244. 129 SYSTEM.ADR(dumstr), SYSTEM.ADR(caption), 0 );
  245. ***** ^ not supported yet
  246. ***** ^ not supported yet
  247. ***** ^ not supported yet
  248. ***** ^ not supported yet
  249. ***** ^ not supported yet
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. 130 END ShowUsage;
  253. ***** ^ not supported yet
  254. 131
  255. 132 BEGIN
  256. 133 Initialized := FALSE;
  257. 134 Init();
  258. ***** ^ not supported yet
  259. ***** ^ not supported yet
  260. 135 END Timing.
  261. ***** ^ not supported yet
  262. 125 errors