Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set century
Message
 
 
To
12/05/2005 11:24:17
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01013353
Message ID:
01013444
Views:
12
>For example, gomonth(SomeDate, -100*12) will subtract 100 years. VFP does all the required calculations.

Yes, I think I would use it. I don't think I will have a problem with 2/29 and for all other dates gomonth will return the exact same date 100 years less.

Here is my code
*---------------------- Location Section ------------------------
*   Library: 	Acustomcontrols.vcx
*   Class: 		TxtDOB
*   Method: 	Valid()
*----------------------- Usage Section --------------------------
*)  Description:
*)

*   Scope:      Public
*   Parameters:
*$  Usage:
*$
*   Returns:
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	04/19/2005 - NN
*		MODIFIED    04/20/2005 - NN
*----------------------------------------------------------------
local llReturn, lcYear, lnYear
if this.lValidationCancelled
	llReturn = .t.
	this.lValidationCancelled = .f.
else
	llReturn = not empty(dodefault())
	if m.llReturn
		lcYear = alltrim(substr(this.text,rat('/',this.text)+1,4))
		if len(m.lcYear)<3 and val(m.lcYear) = year(date())%100 && Same year typed as 2 digits
			this.value = iif(this.value > date(), gomonth(this.value, - 100*12),
		endif
		if this.value > date()
			llReturn = .f.
			=ErrorMsg ("Date of birth could not be greater than today's day!")
		endif
	endif
endif

return m.llReturn
and I set nCentury and nRollover properties in the Property sheet.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform