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






_______________________________________________ use-revolution mailing list [email protected] http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to