* Name - DCHK * Called By - TCL * Description - Utilities - Convert Date entered at TCL * Version - 30 Dec 2000 - INTERNET * Written by Nigel Peachey - Nine Elms Solutions Ltd * *<----------------------------------- COPYRIGHT NOTICE -----------------------------------> * Copyright 2000 - Nigel Peachey - email nigel@nineelms.com * * THIS HEADER MUST REMAIN INTACT IN THIS AND ANY CHANGED VERSION OF THIS ROUTINE * * DCHK may be used and modified free of charge by anyone so long as this * copyright notice and comments above remain intact. By using this code you * agree to indemnify Nigel Peachey from any liability that may arise from its use. * * Selling the code for this program without prior written consent is * expressly forbidden. In other words, please ask first before you try and * make money off my program. * * Obtain permission before redistributing this software over the Internet or * in any other medium. In all cases copyright and the header must remain intact * *<------------------------------------------------------------------------------------------> * PROMPT "" CRT @(-1) COMMAND = SENTENCE() DCHK = FIELD(COMMAND,' ',2) IF DCHK = '' THEN DCHK = OCONV(DATE(),'D2/') ORIG = DCHK ERM = '' BEGIN CASE CASE DCHK MATCHES '1N0N' OR DCHK MATCHES '-1N0N' OUTD = OCONV(DCHK,'D4') DW = OCONV(OCONV(DCHK,'DWA'),'MCT') IF OUTD = '' THEN ERM = "Invalid date entered" END CASE 1 OUTD = ICONV(DCHK,'D4') DW = OCONV(OCONV(OUTD,'DWA'),'MCT') ORIG = OCONV(OUTD,'D4') IF OUTD = '' THEN ERM = "Invalid date entered" END END CASE IF ERM NE '' THEN CRT ERM END ELSE CRT @(10):"Entered = ":ORIG:", converts to ":OUTD:", Day '":DW:"'": END STOP