home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-14 | 968 b | 46 lines | [TEXT/PJMM] |
- unit IDLE;
-
- interface
-
- uses
- ParameterDef;
-
- procedure Main (var p: parameterRecord);
-
- implementation
-
- procedure Main (var p: parameterRecord);
- procedure MyTimeString (secs: longInt; withsecs: boolean; var s: str255);
- function mts (units, count: longInt; pair: boolean): str255;
- var
- t: longInt;
- s: str255;
- begin
- t := secs div units mod count;
- NumToString(t, s);
- if pair then
- if length(s) < 2 then
- s := concat('0', s);
- mts := s;
- end;
- begin
- s := concat(mts(3600, 24, false), ':', mts(60, 60, true));
- if secs > 86400 then
- s := concat(mts(86400, 10000, false), 'd ', s);
- if withsecs then
- s := concat(s, ':', mts(1, 60, true));
- end;
- var
- t: longInt;
- begin
- t := p.idle;
- UprString(p.param^, false);
- if p.param^ = 'TIMESEC' then
- MyTimeString(t, true, p.returnValue^)
- else if p.param^ = 'TIME' then
- MyTimeString(t, false, p.returnValue^)
- else
- p.returnValue^ := '?';
- end;
-
- end.