Calculating age and years of service

fp at mccabes.us fp at mccabes.us
Mon Oct 20 12:14:16 PDT 2008


Quoting Jose Lerebours <fp at fpgroups.com>:

> Check this out:
>
>   1  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> @keym  þ If:        Then: dim info(3)(6,.0)   2  -------   -   -   -  
>    -   -   -   -   -   -   -   -   -   -   -
>        þ If:        Then: ya(8,mdy/)="01/17/72"; yb(8,mdy/)=@td;   
> gosub LOOPAGE   3  -------   -   -   -   -   -   -   -   -   -   -    
>  -   -   -   -
>        þ If:        Then: info("1")=int(info("2")/"12") ;   
> info("3")=yc-yb   4  -------   -   -   -   -   -   -   -   -   -   -  
>    -   -   -   -
>        þ If:        Then: info("2")=(frac(info("2")/"12"))*"12"   5   
>  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>        þ If:        Then: yx="Y: "&info("1")&"\nM: "&info("2")&"\nD:  
>  "   6  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   
>  -
>        þ If:        Then: yx=yx&info("3"); show ""; msgbox yx   7    
> -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>        þ If:        Then: end   8  -------   -   -   -   -   -   -    
>  -   -   -   -   -   -   -   -
> LOOPAGEþ If:        Then: yd(4,.0)=eom(dom(ya)); yd=eom(ya)+yd;   
> yc(8,mdy/)=ya+yd   9  -------   -   -   -   -   -   -   -   -   -     
> -   -   -   -   -
>        þ If: ya eq yc        Then: yc=eom(yc+"1")  10  -------   -    
>  -   -   -   -   -   -   -   -   -   -   -   -   -
>        þ If: yc gt yb        Then: return  11  -------   -   -   -    
>  -   -   -   -   -   -   -   -   -   -   -
>        þ If:        Then: info("2")=info("2")+"1"; ya=yc; goto   
> LOOPAGE Please note that I have not tested this beyond what is shown  
>  and you should test/modify code prior to put it into production.    
> This is just an attempt to help you get started.
>
> Regards,
>
>
> Jose Lerebours

Thanks Jose.  I'll give it a try, probably tomorrow.

Dan




More information about the Filepro-list mailing list