Date Comparison Problems (was Date)

Mark Smith mark at maseurope.net
Sat Sep 9 18:31:01 EDT 2006


I think the main thing is that the keys of an array in Revolution are  
not in any particular order, so when you  <combine TheDOB with "/">,  
you proabaly don't have the elements in the right order (see the  
recent "the keys of my array" thread).

Best,

Mark

On 9 Sep 2006, at 22:50, Ian McKnight wrote:

> Hi
>
> 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,
>
>
> TIA
>
>
> Regards
>
> Ian
>
> =======================
> Ian McKnight
>
> iangmcknight at googlemail.com
> =======================
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list