home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
varia
/
fiasco_1.2
/
arexx
/
age.rexx
next >
Wrap
OS/2 REXX Batch file
|
1977-12-31
|
1KB
|
42 lines
/* age.rexx
* ARexx script for calculating of the age using
* "Day of birth" and current date
* Copyright © 1995 Nils Bandener
* $VER: age.rexx 3.2 (9.12.95)
*/
Options Results
Address FIASCO
F_GetFieldCont "DayOfBirth" /* Insert here the field ID
* of the field, which contains
* the day of birth
*/
Date = Result
Parse Var Date GDay "." GMonth "." GYear /* ARexx makes parsing
* of the string
* very easy
*/
Parse Value Date(European) With ADay "/" AMonth "/" AYear /* The dateformat of
* ARexx is a bit diffrent
*/
if length(GYear) <= 2 then GYear = GYear + 1900 /* Years with two digits are
* supposed to be in
* the 20th century
*/
if length(AYear) <= 2 then AYear = AYear + 1900
DYear = AYear - GYear
if GMonth > AMonth then DYear = DYear - 1
else if GMonth = AMonth & GDay > ADay then DYear = DYear - 1
F_SetFieldCont "Age" DYear /* Insert here the correct field ID, too
*/