Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox Value property disappears
Message
From
31/10/2002 19:07:29
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00717555
Message ID:
00717634
Views:
19
Hi, Mike-

Is the snow flying in Taos, yet?

>This appears to be a bug in 7 and (slightly different) 8.
>
>Create a new form and drop a textbox on it. Set the value property to ={} and put this code in the InteractiveChange() event:
>
>if type('this.value')='U'
> wait window nowait noclear 'This.Value is Missing! '+time()
>else
> wait window nowait noclear transform(this.Value)+' '+time()
>endif
>
>Type in today's date with a 4 digit year and watch as you type each character. When you type in the 3rd character of the year, you'll notice that "This.Value" does not exist.

I can't duplicate your problem (my example follows). There are plenty of places for us to be doing things differently, though, so I'd be interested if my example works or doesn't for you. What I am seeing is that the TextBox Century property doesn't seem to have any effect at all. Here's the code:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


	**************************************************
*-- Form:         form1 (c:\temp\textboxvalue.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   10/31/02 04:06:12 PM
*
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT text1 AS textbox WITH ;
		Century = 0, ;
		Alignment = 3, ;
		Value = {}, ;
		Format = "D", ;
		Height = 23, ;
		Left = 64, ;
		Top = 92, ;
		Name = "Text1"


	ADD OBJECT label1 AS label WITH ;
		AutoSize = .T., ;
		Caption = ("Set CENTURY = " + SET('CENTURY')), ;
		Height = 17, ;
		Left = 64, ;
		Top = 28, ;
		Width = 112, ;
		Name = "Label1"


	ADD OBJECT label2 AS label WITH ;
		AutoSize = .T., ;
		Caption = ("Set DATE  = " + SET('DATE')), ;
		Height = 17, ;
		Left = 64, ;
		Top = 53, ;
		Width = 131, ;
		Name = "Label2"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 118, ;
		Left = 64, ;
		Height = 27, ;
		Width = 99, ;
		Caption = "View debugout", ;
		Name = "Command1"


	PROCEDURE Load
		SET CENTURY ON
		SET DATE AMERICAN
		SET DEBUGOUT TO DebugDateText.TXT
	ENDPROC


	PROCEDURE text1.InteractiveChange
		IF TYPE('this.value')='U'
			DEBUGOUT 'This.Value is Missing! '+TIME()
		ELSE
			DEBUGOUT TRANSFORM(THIS.VALUE)+' '+TIME()
		ENDIF
	ENDPROC


	PROCEDURE text1.Valid
		SET DEBUGOUT TO
	ENDPROC


	PROCEDURE command1.Click
		SET DEBUGOUT TO
		MODIFY FILE DebugDateText.TXT
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform