          ***********  GETDATE COMMAND FILE  **************
* Confirms that the date is entered as YYMMDD by checking to see that
* the entries for each item are in the correct range.  The year is
* checked against a constant stored in the B:Constant.MEM file.
**********************************************************************

STORE 'T' TO NoDate
DO WHILE !(NoDate) <> 'F'
   ERASE
   STORE 'YYMMDD' TO Date
   @ 5,10 SAY "Enter TODAY'S date" GET Date
   ? CHR(7)
   READ

   IF VAL($(Date,1,2)) <> ThisYear;
         .OR. VAL($(Date,3,2)) < 1 .OR. VAL($(Date,3,2)) > 12;
         .OR. VAL($(Date,5,2)) < 1 .OR. VAL($(Date,5,2)) > 31
      @ 10,25 SAY 'DATE ERROR'
      STORE 0 TO X
      DO WHILE X < 50
         STORE X + 1 TO X
      ENDDO
   ELSE
      ?
      @ 10,0 SAY '   C to CHANGE the date,'
      ? '<Return> to continue.'
      WAIT TO Change
      IF !(Change) <> 'C'
         STORE 'F' TO NoDate
      ENDIF
   ENDIF
ENDDO NoDate

RELEASE NoDate, Change, X
RETURN
