User Tools

Site Tools


cdc:nos2.source:nam5871:dlckti

DLCKTI

Table Of Contents

  • [00003] PROC DLCKTI(TIMEF, ERRCODE)

Source Code

DLCKTI.txt
  1. *DECK DLCKTI
  2. USETEXT DLFPDEF
  3. PROC DLCKTI(TIMEF, ERRCODE); # CHECK CLOCK TIME IN DISPLAY CODE #
  4. *IF DEF,IMS
  5. #
  6. *1DC DLCKTI
  7. *
  8. * 1. PROC NAME AUTHOR DATE.
  9. * DLCKTI P.C.TAM 78/11/07
  10. *
  11. * 2. FUNCTIONAL DESCRIPTION.
  12. * CHECK TIME FIELD FOR ERROR.
  13. *
  14. * 3. METHOD USED.
  15. * CHECK EACH DIGIT TO BE NUMERIC
  16. * CHECK HOUR WITHIN 0 AND 24,
  17. * CHECK MIMUNTE AND SECOND TO BE WITHIN 0 AND 60.
  18. *
  19. * 4. ENTRY PARAMETERS.
  20. * TIMEF CLOCK TIME INPUT
  21. *
  22. * 5. EXIT PARAMETERS.
  23. * ERRCODE ERROR RETURN CODE
  24. *
  25. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  26. * DLFPDEF
  27. *
  28. * 7. ROUTINES CALLED.
  29. * NONE.
  30. *
  31. * 8. DAYFILE MESSAGES.
  32. * NONE.
  33. *
  34.  #
  35. *ENDIF
  36. #
  37.   LOCAL VARIABLES
  38. #
  39. ITEM
  40. TIMEF U, # CLOCK TIME #
  41. ERRCODE I, # ERROR RETURN CODE #
  42. D1 I, # DIGIT ONE #
  43. D2 I, # DIGIT TWO #
  44. D3 I, # DIGIT THREE #
  45. D4 I, # DIGIT FOUR #
  46. D5 I, # DIGIT FIVE #
  47. D6 I, # DIGIT SIX #
  48. HH I, # HOUR #
  49. MM I, # MINUTES #
  50. SS I; # SECONDS #
  51. # ******************************************************************** #
  52. BEGIN
  53. D1 = C<0,1>TIMEF - O"33";
  54. D2 = C<1,1>TIMEF - O"33";
  55. D3 = C<2,1>TIMEF - O"33";
  56. D4 = C<3,1>TIMEF - O"33";
  57. D5 = C<4,1>TIMEF - O"33";
  58. D6 = C<5,1>TIMEF - O"33";
  59. HH = D1 * 10 + D2; # HOUR #
  60. MM = D3 * 10 + D4; # MINUTE #
  61. SS = D5 * 10 + D6; # SECONDS #
  62. IF C<6,4>TIMEF EQ 0 AND # CLOCK TIME MUST HAVE 6 DIGITS #
  63. (0 LQ D1 AND D1 LQ 9) AND # CHAR IS NUMERIC #
  64. (0 LQ D2 AND D2 LQ 9) AND # CHAR IS NUMERIC #
  65. (0 LQ D3 AND D3 LQ 9) AND # CHAR IS NUMERIC #
  66. (0 LQ D4 AND D4 LQ 9) AND # CHAR IS NUMERIC #
  67. (0 LQ D5 AND D5 LQ 9) AND # CHAR IS NUMERIC #
  68. (0 LQ D6 AND D6 LQ 9) AND # CHAR IS NUMERIC #
  69. 0 LQ HH AND HH LQ 24 AND # HOUR MUST BE BETWEEN 0 / 24 #
  70. 0 LQ MM AND MM LQ 59 AND # MINUTE BETWEEN 0 / 59 #
  71. 0 LQ SS AND SS LQ 59 AND # SECONDS BETWEEN 0 / 59 #
  72. ((HH EQ 24 AND MM EQ 0 AND# IF HOUR IS 24, MM, SS MUST BE 0 #
  73. SS EQ 0) OR HH NQ 24)
  74. THEN
  75. ERRCODE = 0;
  76. ELSE
  77. ERRCODE = 1;
  78. END
  79. TERM
cdc/nos2.source/nam5871/dlckti.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator