Proper Field Validation Methods and other annoyances...

Ken Ray kray at sonsothunder.com
Tue Aug 14 12:55:45 EDT 2007


On Tue, 14 Aug 2007 18:43:01 +0200, Björnke von Gierke wrote:

> On 14 Aug 2007, at 18:25, Len Morgan wrote:
> 
>> 1) Why does  put "4" is a date return true?  If this function 
>> doesn't actually work, why is it still available?  I'd like to be 
>> able to have users enter a date without any kind of punctuation 
>> (i.e., 08142007) and be able to validate it as a valid date.  The 
>> same applies to entering 1315 as a time (no colon).
> 
> Basically you have to do your own validation for any date or time 
> that is not known to be correct already, and "is a date" is extremely 
> useless.

Right - you may want:

  if (length(tDate) = 8) and (tDate is a date) then

Just an idea...

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