The following function returns someone’s age. The first required parameter is the birthdate. The second optional parameter is the date to calculate the age. If the second parameter is not specified, the current date is used.

function age( dBirth, dCheck )

   if argcount( ) < 2 

      dCheck = date( ) 

   endif 

 return floor( ( val( dtos( dCheck )) - val( dtos( dBirth )) ) / 10000 )