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         |     [EMAIL PROTECTED]
HyperActive Software           |     http://www.hyperactivesw.com
_______________________________________________
use-revolution mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to