Date Validation and MatchText

Jeff Honken jhonken at x12.info
Thu Dec 22 13:40:37 EST 2005


Thanks for the reply Ken that does work well.  I'd like to try to
restrict the date to a pattern of mm/dd/yyyy.  Using "date" allow dates
such as mm/d/y.  Do you know how to parse the date string to match
mm/dd/yyyy only?

> I've been trying to write some error coding for a text field
containing
> a date.  I found some old code that someone wrote in the past but I'm
> having a hard time figuring out how it's working.  I'm trying to get
the
> code so if the Year is 5 digits it gets flagged as a bad date.  The
> pattern I'm trying to check is:  mm/dd/yyyy

You should be able to just say:

  if pDateToCheck is a date then  ...

No need to run a function unless you are planning on checking a bunch of
other date formats that aren't support by the "is a date" approach (like
MySQL's YYYY-MM-DD)...


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com








More information about the use-livecode mailing list