Ian McKnight iangmcknight at
Sat Sep 9 17:49:02 EDT 2006


I have a stack which calls for a date to be entered.
As part of the validation checks I split the date into an array.
Once the date has been validated I then want to ensure that it is not
in the future.
So I compare the valid input date with the current date.

The straight comparison code of

if theDOB > theDateNow then .....

failed so the code I use is converts both dates to seconds

  -- check if date is in the future
  put theDOBA into theDOB
  combine theDOB with "/"
  convert theDOB to short date -- to ensure that it is treated as a
date - seems to make no difference
  convert theDOB to seconds --------- fails here

theDOBA is an array containing a date in the form DD MM YYYY - one
element per key

When I enter a date eg "19/3/1984" the variable theDOB is not
cenverted but remains in date form, however this code to convert the
current date to seconds works fine

  put the short date into theDateNow
  set itemdelimiter to "/"
  put 20 before item 3 of theDateNow -- ensure 4 digit year
  convert theDateNow to seconds

I would appreciate any guidance as my reassembled date does not seem
to be treated as a date,




Ian McKnight

iangmcknight at

More information about the Use-livecode mailing list