| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- 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
|