Date 1935

Serge Ségu serge.segu at free.fr
Tue Apr 19 13:36:22 EDT 2005


Hello

The script  below is OK with HyperCard
but  with DreamCard it returns a negative number with year < 1935
what must I modify ?

Best regards
Serge
--
on mouseUp
   answer calcAge ("1/1/1934")
end mouseUp

function calcAge x
   put x into calc -- day of birth
   convert calc to seconds
   put ((the seconds - calc)/86400) into calc -- 86400 s = 1day
   set itemDelimiter to "."
   if calc < 30 then -- newborn
     delete last item of calc
     put " days." after calc
   else
     if calc ³ 30 and calc ² 913 then -- enfant
       put (calc / 30)  into calc
       delete last item of calc
       put" months." after calc
     else -- child or adult
       if calc >913 then
         put( calc / 365)  into calc
         delete last item of calc
         put" years." after calc
       end if
     end if
   end if
   return calc
end calcAge

-- 
Serge SƒGU
AIM : mullowill
http://wirinum.free.fr
PGP: 0xB6132583








More information about the use-livecode mailing list