Proper Field Validation Methods and other annoyances...

Ken Ray kray at sonsothunder.com
Tue Aug 14 14:14:36 EDT 2007


On Tue, 14 Aug 2007 19:20:17 +0200, Björnke von Gierke wrote:

>> This is something I asked earlier, and basically since "the seconds" is
>> a valid date, the "is a date" test returns true for any positive
>> integer. However I made the argument that it should be at least 10
>> digits, but that hasn't been adopted yet.
> 
> Wow that'd be seriously evil. Just imagine the help calls when 
> suddenly date stuff stops working because one number is too small, or 
> too big, or the moon isn't full! Either have it removed from "is a 
> date", or leave it as is.  Can you tell me where you suggested that, 
> so I can put in an opposite comment?

It's not in Bugzilla - it was an email conversation with Mark 
Waddingham, and IIRC, Mark W. responded with a better way to handle 
things anyway. It might not have been 10 digits (it might have been 9 
or 8 - I was going for the earliest date we could convert properly, 
represented in seconds). However the point is moot, since I know they 
want to support any date (even before the "system clock" date of 1970 
(I think)), so they'll come up with a completely different method I'm 
sure.

> As for really fixing "is a date" Ideally one could specify what 
> should evaluate true as a date (and there should be "is a time" too), 
> with the local date format as the default. Actually I liked this idea 
> so much, i went and made a feature request (bug 5300).

Well, now *I'm* on the other side... although it is pretty easy to 
manage what users put into a program you design (so you can limit/force 
specific date formats), if you're doing something like importing data 
from other sources and you don't know what format a "date column" is 
in, you'd have to run through a bunch of "is a date" checks, setting 
the dateFormat for each one you think might be right - OR - you'd have 
to pick apart a date in that column and try to figure out which format 
it used. I like that "is a date" is very open, but I think it should be 
restricted to actual recognizable date formats - I don't think anyone 
would say that "31557600" is recognized as a date... :-)

Just my 2 cents,

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



More information about the use-livecode mailing list