tldm-universe/CMS/BP.CLOCK/TTIME

24 lines
635 B
Plaintext
Raw Normal View History

2024-09-10 19:25:06 +00:00
SUBROUTINE TTIME
****************************************
* This subroutine returns the number of
* hours worked by a given employee.
* It is called from dictionary item
* TTIME in CLOCKFILE.
****************************************
$INCLUDE ACCESS.COMMON
$INCLUDE GEN.COM2
OPEN FILENAME$ TO CLOCKFILE ELSE ABORT 201,FILENAME$
READ REC FROM CLOCKFILE,ID$ THEN
REC.CNT=DCOUNT(REC,VM)
IF REM(REC.CNT,2) THEN REC.CNT=REC.CNT-1
TTIME=0
FOR X=1 TO REC.CNT STEP 2
TTIME=TTIME+(REC<1,X+1>-REC<1,X>)
NEXT X
TTIME=INT(TTIME/60)
HOURS=INT(TTIME/60)
MINUTES=REM(TTIME,60)'R%2'
CURRENT$=HOURS:":":MINUTES
END
RETURN CURRENT$