Page 1 of 1

Posted: Mon Jan 20, 2003 9:00 am
by cmueller
Try: If Not(Arg1 Matches "2N":"/":"2N":"/":"4N") Then...

Posted: Mon Jan 20, 2003 4:32 pm
by ray.wurlod
"D4-DMY" is an argument for am Iconv() or Oconv() function. Specifically, it is not a pattern that can be used by the Matches operator.
To check whether a date is valid, check the value returned by the Status() function once an Iconv() has been applied.
To check whether it's a valid date pattern, as cmueller suggests, is not sufficient, as it would allow "78/82/0001".

Example Routine to test valid date:

FUNCTION IsValidDate(Arg1)
* Returns 1 if Arg1 is valid date, 0 otherwise.
* Iconv doesn't have to worry about actual delimiter.
* However, we do require a four digit year.
Test = Iconv(Arg1, "D4DMY")
* Status() returns 0 for valid date
Ans = Not(Status())
RETURN(Ans)


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518