Date 1935

J. Landman Gay jacque at hyperactivesw.com
Tue Apr 19 15:04:51 EDT 2005


On 4/19/05 12:36 PM, Serge Ségu wrote:

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

See the "centuryCutoff" property in the docs. This determines how 
2-digit years are interpreted. It is set to 1935 by default, but you can 
change it.

> 
> 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
> 


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list