Computing the age of a person?

Mark Schonewille m.schonewille at economy-x-talk.com
Thu May 14 11:05:19 EDT 2009


Hi Klaus,

Please test:

function age theDate
      set the useSystemDate to true
      convert theDate to dateItems
      put the date into myToday
      convert myToday to dateitems
      put item 1 of myToday - item 1 of theDate - 1 into myAge
      put item 1 of myToday into item 1 of theDate
      convert theDate to seconds
      if theDate < the seconds then add 1 to myAge
      return myAge
end age

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
Dutch forum: http://runrev.info/rrforum

New: Snapper Screen Recorder 2.0.1
Download at http://snapper.economy-x-talk.com

On 14 mei 2009, at 16:39, klaus at major.on-rev.com wrote:

> Hi all,
>
> I could need a hint on how to compute the age of a person when I  
> have the birthday.
> The "convert to seconds" and "subtract"ion part is easy, but how to  
> proceed? :-)
>
> Thanks in advance!
>
>
> Best
>
> Klaus




More information about the use-livecode mailing list