Listing: 1 IMPLEMENTATION MODULE Timing; 2 (* 3 * REPERTOIRE 4 * Release 1.6 5 * By Charles Bradford and Cole Brecheen 6 * (c) Copyright 1985-1992 PMI 7 * Green Bay, Wisconsin 8 * All rights reserved 9 * (414) 468-6040 10 * 11 * $Header: D:/logfiles/mods/timing.mov 1.7 10 Mar 1991 15:34:00 coleb $ 12 * 13 *) 14 15 16 (*EntryDiag: 17 IMPORT Diagnostics; 18 :EntryDiag*) 19 20 IMPORT EnvironUtils; 21 IMPORT M2Strings; 22 IMPORT StrConv; 23 IMPORT StrEdit; 24 IMPORT SYSTEM; 25 IMPORT VWindows; 26 27 VAR 28 Initialized : BOOLEAN; 29 30 PROCEDURE Init(); 31 BEGIN 32 IF Initialized THEN 33 RETURN; 34 ELSE 35 Initialized := TRUE; 36 END; 37 (*EntryDiag: 38 Diagnostics.Init(); 39 :EntryDiag*) 40 41 EnvironUtils.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 42 M2Strings.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 43 StrConv.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 44 StrEdit.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 45 VWindows.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 46 47 (*EntryDiag: 48 Diagnostics.diagS( 'Entering Timing', '' ); 49 :EntryDiag*) 50 51 BeginTimer(); ***** ^ undeclared identifier ***** ^ not supported yet 52 53 (*EntryDiag: 54 Diagnostics.diagS( 'Exiting Timing', '' ); 55 :EntryDiag*) 56 END Init; ***** ^ not supported yet 57 58 59 VAR 60 hours, minutes, seconds, hunds : CARDINAL; 61 62 PROCEDURE BeginTimer(); 63 VAR 64 dumstr : ARRAY [0..80] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 65 BEGIN 66 EnvironUtils.GetTime(hours, minutes, seconds, hunds, dumstr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 67 END BeginTimer; ***** ^ not supported yet 68 69 PROCEDURE ReadTimer(VAR hout, mout, sout, hunout : CARDINAL); 70 VAR 71 dumstr : ARRAY [0..20] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 72 hused, mused, sused, hunused : INTEGER; 73 BEGIN 74 EnvironUtils.GetTime(hout, mout, sout, hunout, dumstr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 75 hunused := INTEGER(hunout)-INTEGER(hunds); ***** ^ not supported yet ***** ^ not supported yet 76 sused := INTEGER(sout)-INTEGER(seconds); ***** ^ not supported yet ***** ^ not supported yet 77 mused := INTEGER(mout)-INTEGER(minutes); ***** ^ not supported yet ***** ^ not supported yet 78 hused := INTEGER(hout)-INTEGER(hours); ***** ^ not supported yet ***** ^ not supported yet 79 IF hunused<0 THEN 80 INC( hunused, 100); ***** ^ undeclared identifier ***** ^ not supported yet 81 DEC( sused); ***** ^ undeclared identifier ***** ^ not supported yet 82 END; 83 IF sused<0 THEN 84 INC( sused, 60); ***** ^ undeclared identifier ***** ^ not supported yet 85 DEC( mused); ***** ^ undeclared identifier ***** ^ not supported yet 86 END; 87 IF mused<0 THEN 88 INC( mused, 60); ***** ^ undeclared identifier ***** ^ not supported yet 89 DEC( hused); ***** ^ undeclared identifier ***** ^ not supported yet 90 END; 91 IF hused<0 THEN 92 (* accounts for use through midnight; but does not 93 handle use for longer than 24 hours *) 94 INC( hused, 24); ***** ^ undeclared identifier ***** ^ not supported yet 95 END; 96 hunout := hunused; 97 sout := sused; 98 hout := hused; 99 mout := mused; 100 END ReadTimer; ***** ^ not supported yet 101 102 PROCEDURE ShowUsage(name : ARRAY OF CHAR); ***** ^ not supported yet 103 VAR 104 h, m, s, hun : CARDINAL; 105 dumstr : ARRAY [0..255] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 106 numstr : ARRAY [0..10] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 107 caption : ARRAY [0..31] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 108 dumc : CARDINAL; 109 BEGIN 110 ReadTimer(h, m, s, hun); ***** ^ not supported yet ***** ^ not supported yet 111 M2Strings.Concat('You have been using ', name, dumstr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 112 StrEdit.Append(dumstr, ' for '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 113 StrConv.CardinalToStr(h*60+m, 1, numstr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 114 StrEdit.Append(dumstr, numstr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 115 StrEdit.Append(dumstr, ' minute'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 116 IF h+h+m#1 THEN 117 StrEdit.Append(dumstr, 's'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 118 END; 119 StrEdit.Append(dumstr, ' and '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 120 StrConv.CardinalToStr(s, 1, numstr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 121 StrEdit.Append(dumstr, numstr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 122 StrEdit.Append(dumstr, ' second'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 123 IF s#1 THEN 124 StrEdit.Append(dumstr, 's'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 125 END; 126 StrEdit.Append(dumstr, ' in this session.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 127 caption := 'Elapsed Time'; ***** ^ not supported yet ***** ^ not supported yet 128 dumc := VWindows.MessageBox( VWindows.CurrentWindow, ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 129 SYSTEM.ADR(dumstr), SYSTEM.ADR(caption), 0 ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 130 END ShowUsage; ***** ^ not supported yet 131 132 BEGIN 133 Initialized := FALSE; 134 Init(); ***** ^ not supported yet ***** ^ not supported yet 135 END Timing. ***** ^ not supported yet 125 errors