FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!

jth tempo




FUNCTION jthtempo
LPARAMETERS vtgl, vtempo
vday = TRANSFORM(DAY(vtgl), '@L 99')
vmonth = TRANSFORM(MONTH(vtgl), '@L 99')
vyear = TRANSFORM(YEAR(vtgl), '@L 9999')
IF MONTH(vtgl)+vtempo>12
vy = 1
vm = MONTH(vtgl)+vtempo-12
DO WHILE vm>12
vy = vy+1
vm = vm-12
ENDDO
vmonth = TRANSFORM(vm, '@L 99')
vyear = TRANSFORM(YEAR(vtgl)+vy, '@L 9999')
vhasil = CTOD(vday+'-'+vmonth+'-'+vyear)
i = 1
DO WHILE EMPTY(vhasil)
vday = TRANSFORM(DAY(vtgl)-i, '@L 99')
vhasil = CTOD(vday+'-'+vmonth+'-'+vyear)
i = i+1
ENDDO
ELSE
vmonth = TRANSFORM(MONTH(vtgl)+vtempo, '@L 99')
vhasil = CTOD(vday+'-'+vmonth+'-'+vyear)
i = 1
DO WHILE EMPTY(vhasil)
vday = TRANSFORM(DAY(vtgl)-i, '@L 99')
vhasil = CTOD(vday+'-'+vmonth+'-'+vyear)
i = i+1
ENDDO
ENDIF
RETURN vhasil
ENDFUNC



0 blog comments below




FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.