! CRS_VAL_ROOM.SCP REB, 06-Jul-1989 08:00 .LABEL INIT !load #symbols from field values... GET #TVALID="Y" GET #ROOM=ROOM GET #BEG_DT=BEG_DT GET #END_DT=#BEG_DT GET #BEG_TIME=BEG_TIME GET #END_TIME=END_TIME !intialize NULL values... GET #CKEY=#B_DTT=#E_DTT="" .LABEL CONVERT_DATES !NOTE: dates will be in #b_dt & #e_dt symbols DATE_CONVERT #B_DT,#BEG_DT,7 GET #E_DT=#B_DT .LABEL CHECK_SPANS GET #B_DTT=#B_DT:8 BEG_TIME:7 GET #E_DTT=#E_DT:8 END_TIME:7 .IF #B_DTT:15 LTS #E_DTT:15 THEN .GOTO VALID_DATES_AND_TIMES .LABEL INVALID_SPAN GET #TVALID="N" OA$MSG_PURGE DISPLAY Your STARTING date is later than your ENDING date! OA$FRM_SET_FIELD BEG_DATE .GOTO EXIT_PROCEDURE .LABEL VALID_DATES_AND_TIMES GET #CKEY=#B_DT:8 #BEG_TIME:7 #E_DT:8 #END_TIME:7 #ROOM:30 GET #TVALID="Y" .IF #CKEY EQS #PKEY THEN .GOTO EXIT_PROCEDURE GET OA$DISPLAY="Checking availability of " #room " . . . "\FORCE .IF OA$MENU_CHOICE EQS "E" THEN .GOTO VALIDATE_ROOM_CHG .LABEL VALIDATE_ROOM GET OA$DCL='OPEN/WRITE OUTFILE INVAL_ROOM.TMP' GET OA$DCL='WRITE OUTFILE "' #ROOM - ' has already been reserved on ' #beg_dt ' for:"' GET OA$DCL='WRITE OUTFILE ""' FOR CRS_RESERVE WITH - .CRS_KEY::30 BEGINNING #ROOM AND - .CRS_KEY:8 BEGINNING #CKEY:8 DO - GET #SD=.CRS_KEY:14\\- GET #ED=.CRS_KEY:14:15\\- .IF - #E_DTT GES #SD AND #ED GES #B_DTT - AND #ED NES #B_DTT AND #SD NES #E_DTT THEN - GET #TVALID="N" \\\\- GET #BD= .BEG_DT \\\\- GET #BT= .CRS_KEY:5:8 \\\\- GET #ED= .END_DT \\\\- GET #ET= .CRS_KEY:5:23 \\\\- GET #MTG= .MEETING \\\\- GET #CT= .CONTACT1 \\\\- GET OA$DCL='$ WRITE OUTFILE - "TIME: ' #BT ' - ' #ET '"' \\\\- GET OA$DCL='$ WRITE OUTFILE "MEETING: ' #MTG '"' \\\\ - GET OA$DCL='$ WRITE OUTFILE "CONTACT: ' #CT '"' \\\\ - GET OA$DCL='$ WRITE OUTFILE ""' GET OA$DCL='$ WRITE OUTFILE ""' GET OA$DCL='WRITE OUTFILE "Please select another ROOM or DATE & TIME."' GET OA$DCL='CLOSE OUTFILE' .IF #TVALID EQS "N" THEN .GOTO INVALID .GOTO ROOM_AVAILABLE .LABEL VALIDATE_ROOM_CHG GET OA$DCL='OPEN/WRITE OUTFILE INVAL_ROOM.TMP' GET OA$DCL='WRITE OUTFILE "' #ROOM - ' has already been reserved for these uses: "' GET OA$DCL='WRITE OUTFILE ""' FOR CRS_RESERVE WITH - .CRS_KEY::30 BEGINNING #ROOM AND - .CRS_KEY:8 BEGINNING #CKEY:8 DO - GET #SD=.CRS_KEY:14\\- GET #ED=.CRS_KEY:14:15\\- .IF - .CRS_KEY NES $CRS_LAST_USED AND - #E_DTT GES #SD AND #ED GES #B_DTT AND - #ED NES #B_DTT AND #SD NES #E_DTT THEN - GET #TVALID="N" \\\\- GET #BD= .BEG_DT \\\\- GET #BT= .CRS_KEY:5:8 \\\\- GET #ED= .END_DT \\\\- GET #ET= .CRS_KEY:5:23 \\\\- GET #MTG= .MEETING \\\\- GET #CT= .CONTACT1 \\\\- GET OA$DCL='$ WRITE OUTFILE - "FROM: (' #BD ' ' #BT ') TO: (' #ED ' ' - #ET ')"' \\\\- GET OA$DCL='$ WRITE OUTFILE "MEETING: ' #MTG '"' \\\\ - GET OA$DCL='$ WRITE OUTFILE "CONTACT: ' #CT '"' \\\\ - GET OA$DCL='$ WRITE OUTFILE ""' GET OA$DCL='$ WRITE OUTFILE ""' GET OA$DCL='WRITE OUTFILE "Please select another ROOM or DATE & TIME."' GET OA$DCL='CLOSE OUTFILE' .IF #TVALID EQS "N" THEN .GOTO INVALID .GOTO ROOM_AVAILABLE .LABEL ROOM_AVAILABLE DELETE INVAL_ROOM.TMP OA$MSG_PURGE GET OA$DISPLAY=- #ROOM " has been RESERVED for you. EXIT SCREEN to cancel."\FORCE .GOTO EXIT_PROCEDURE .LABEL INVALID LIST INVAL_ROOM.TMP DELETE INVAL_ROOM.TMP .GOTO EXIT_PROCEDURE .LABEL EXIT_PROCEDURE .EXIT