Leston Drake wrote:

> I would like to compare the current date to some future date, say 12/31/34.
> 
> But MetaCard evaluates the following
> the date < 12/31/34
> as False...?
> 
> It doesn't seem to be doing a strict string compare, because it evaluates
> "10/1/01" < "12/31/34"
> as True (which you would expect with a string comparison).
> 
> Can anyone explain how it is evaluating "the date < 12/31/34"?
> 
> Is there some other way to compare 2 dates?

Convert them to integers using the seconds format:

  function isLater pBaseDate, pCompareDate
    convert pBaseDate to seconds
    convert pCompareDate to seconds
    return (pCompareDate > pBaseDate)
  end isLater

MC's internal date routines only cover the period from 1/1/1935 to 1/1/2034;
to handle a larger set of dates, use the Julian2Date and Date2Julain
functions posted here recently.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Multimedia Design and Development for Mac, Windows, UNIX, and the Web
 _____________________________________________________________________
 [EMAIL PROTECTED]                 http://www.FourthWorld.com
 Tel: 323-225-3717        AIM: FourthWorldInc        Fax: 323-225-0716



Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to