*DECK DLCKTI USETEXT DLFPDEF PROC DLCKTI(TIMEF, ERRCODE); # CHECK CLOCK TIME IN DISPLAY CODE # *IF DEF,IMS # *1DC DLCKTI * * 1. PROC NAME AUTHOR DATE. * DLCKTI P.C.TAM 78/11/07 * * 2. FUNCTIONAL DESCRIPTION. * CHECK TIME FIELD FOR ERROR. * * 3. METHOD USED. * CHECK EACH DIGIT TO BE NUMERIC * CHECK HOUR WITHIN 0 AND 24, * CHECK MIMUNTE AND SECOND TO BE WITHIN 0 AND 60. * * 4. ENTRY PARAMETERS. * TIMEF CLOCK TIME INPUT * * 5. EXIT PARAMETERS. * ERRCODE ERROR RETURN CODE * * 6. COMDECKS CALLED AND SYMPL TEXTS USED. * DLFPDEF * * 7. ROUTINES CALLED. * NONE. * * 8. DAYFILE MESSAGES. * NONE. * # *ENDIF # LOCAL VARIABLES # ITEM TIMEF U, # CLOCK TIME # ERRCODE I, # ERROR RETURN CODE # D1 I, # DIGIT ONE # D2 I, # DIGIT TWO # D3 I, # DIGIT THREE # D4 I, # DIGIT FOUR # D5 I, # DIGIT FIVE # D6 I, # DIGIT SIX # HH I, # HOUR # MM I, # MINUTES # SS I; # SECONDS # # ******************************************************************** # BEGIN D1 = C<0,1>TIMEF - O"33"; D2 = C<1,1>TIMEF - O"33"; D3 = C<2,1>TIMEF - O"33"; D4 = C<3,1>TIMEF - O"33"; D5 = C<4,1>TIMEF - O"33"; D6 = C<5,1>TIMEF - O"33"; HH = D1 * 10 + D2; # HOUR # MM = D3 * 10 + D4; # MINUTE # SS = D5 * 10 + D6; # SECONDS # IF C<6,4>TIMEF EQ 0 AND # CLOCK TIME MUST HAVE 6 DIGITS # (0 LQ D1 AND D1 LQ 9) AND # CHAR IS NUMERIC # (0 LQ D2 AND D2 LQ 9) AND # CHAR IS NUMERIC # (0 LQ D3 AND D3 LQ 9) AND # CHAR IS NUMERIC # (0 LQ D4 AND D4 LQ 9) AND # CHAR IS NUMERIC # (0 LQ D5 AND D5 LQ 9) AND # CHAR IS NUMERIC # (0 LQ D6 AND D6 LQ 9) AND # CHAR IS NUMERIC # 0 LQ HH AND HH LQ 24 AND # HOUR MUST BE BETWEEN 0 / 24 # 0 LQ MM AND MM LQ 59 AND # MINUTE BETWEEN 0 / 59 # 0 LQ SS AND SS LQ 59 AND # SECONDS BETWEEN 0 / 59 # ((HH EQ 24 AND MM EQ 0 AND# IF HOUR IS 24, MM, SS MUST BE 0 # SS EQ 0) OR HH NQ 24) THEN ERRCODE = 0; ELSE ERRCODE = 1; END TERM