home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
TURBOPAS
/
TP-UTIL.ARK
/
MARKTIME.SRC
< prev
next >
Wrap
Text File
|
1986-01-06
|
2KB
|
63 lines
{->>>>MarkTime<<<<---------------------------------------------}
{ }
{ Filename: MARKTIME.SRC -- Last Modified 10/26/85 }
{ }
{ This routine returns in TimeRec Delta the time difference }
{ between the time passed to it in Mark and the current time. }
{ It requires a prior definition of type TimeRec: }
{ }
{ TimeRec = Record }
{ TimeComp : Integer; }
{ TimeString : String80; }
{ Hours,Minutes,Seconds,Hundredths : Integer }
{ END; }
{ }
{ NOTE: This routine will not operate correctly for intervals }
{ longer than 24 hours! }
{--------------------------------------------------------------}
PROCEDURE MarkTime(Var Mark,Delta : TimeRec);
TYPE
Reg = RECORD
CASE Boolean OF
False : (Word : Integer);
True : (LoByte,HiByte : Byte)
END;
Regpack = RECORD
AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : Reg
END;
VAR
TempTime : TimeRec;
TempSeconds,DeltaSeconds : Real;
FUNCTION TimeToSeconds(T : TimeRec) : Real;
BEGIN
WITH T DO TimeToSeconds := (Hours * 3600) + (Minutes * 60) +
Seconds + (Hundredths * 0.01);
END;
BEGIN
GetTime(TempTime);
IF TempTime.TimeComp < Mark.TimeComp THEN
BEGIN
TempSeconds := TimeToSeconds(Mark) + 86400.0;
DeltaSeconds := TimeToSeconds(TempTime) - TempSeconds
END
ELSE
DeltaSeconds := TimeToSeconds(TempTime)-TimeToSeconds(Mark);
WITH Delta DO
BEGIN
Hundredths := Trunc(Frac(DeltaSeconds) * 100);
DeltaSeconds := Int(DeltaSeconds);
TempSeconds := Int(DeltaSeconds / 3600.0);
Hours := Trunc(TempSeconds);
DeltaSeconds := DeltaSeconds - (Hours * 3600.0);
Minutes := Trunc(DeltaSeconds / 60);
Seconds := Trunc(DeltaSeconds - (Minutes * 60.0));
END
END;
Q°⌡╡ ª╪NñÉÄ╣▀╩Y╪∞Iû₧4]╥Ö─½@$ ╧"▌└i╪█ÿåF∙╕X╧J│╒n╦/Ö─x┐Ä├╫╧òÿÉ╪εIsaÇ╤└°±╡AH∩°▓DDß9─1╖-╥æk/J╣Y