Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
D Format analogue for the datetime field
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
D Format analogue for the datetime field
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01078457
Message ID:
01078457
Views:
62
Hi everybody,

I think there is no solution for the problem I'll describe bellow but here it goes anyway.

I have a special textbox class called txtDate. This class has the following code in its Init:
if not dodefault()
	return .f.
endif

with this
	if empty(.cControlSource)
		.cControlSource = .controlsource
	endif

	if empty(.cControlSource)
		if .lDateTime
			.value = iif(.lCurrent,datetime(),{//::}) && Initialize with the current or empty datetime
		else
			.value = iif(.lCurrent,date(),{}) && Initialize with the current or empty date
		endif
	endif

	if type('.ControlSource') = "C" or .lDateTime
		do case
		case .lDateTime OR type(.controlsource) = "T"
			* we can not set format to R
			.Format = "R"

		otherwise
			.format = "D"
			.inputmask = ""
		endcase
	endif
endwith
I use StrictDataEntry property as 0 - Loose and InputMask as =strtran(CHRTRAN(TRANSFORM(DATETIME()),"1234567890","9999999999"),"P","A")

The problem is when I want to use this control for time dataentry. The separators don't stay put...

Any way to solve the problem? I really need a "T" format which would be the same as "D" for datetime.

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform