06-11-2005, 07:07 AM
Neo and Deleter,
Check me out on the following:
I think the logic that both of you have at the end of the program where you finally compute the person's age, is a bit complicated. It has too many IF's.
They way I see it is as follows:
* We have done all the validations already, including that the date of birth is not in the future.
* Create a 4 byte variable called BMMDD$ which contains the month and day of the birth date.
* Create another 4 byte variable called CMMDD$ from the current date.
* We should already have a numeric variable called BYEAR for the year of the date of birth, and one called CYEAR for the year from the current date.
* Now we're ready to compute the AGE:You guys have been testing this problem much more than I, so tell me, will the above work? If not, why?
Thanks.
*****
Check me out on the following:
I think the logic that both of you have at the end of the program where you finally compute the person's age, is a bit complicated. It has too many IF's.
They way I see it is as follows:
* We have done all the validations already, including that the date of birth is not in the future.
* Create a 4 byte variable called BMMDD$ which contains the month and day of the birth date.
* Create another 4 byte variable called CMMDD$ from the current date.
* We should already have a numeric variable called BYEAR for the year of the date of birth, and one called CYEAR for the year from the current date.
* Now we're ready to compute the AGE:
Code:
AGE = CYEAR - BYEAR
IF BMMDD$ < CMMDD$ THEN AGE = AGE - 1
Thanks.
*****