Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: with a Blank numeric field a zero is added
Message
De
25/06/2004 07:59:14
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Titre:
BUG: with a Blank numeric field a zero is added
Divers
Thread ID:
00917157
Message ID:
00917157
Vues:
49
Subject: the thread #916378 open a issue, the analysis demonstrates that it is a bug

VFP versions : 6 7 8 9b

Observed:
when a blank numeric field is edited into a TextBox,
and the InputMask is not a empty or a pure "99999..." string,
the textbox add a zero to the .Text value;
when you exit with ENTER the zero is ignored,
when you exit with TAB the zero is used for build the .Value

Expected: no zero added

Repro code, automatic,
observed : a 50 into the textBox,
expected a 5 into the TextBox:
PUBLIC oform1

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

DEFINE CLASS form1 AS form

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

	ADD OBJECT text1 AS textbox WITH ;
		Alignment = 3, ;
		ControlSource = "test.numeric", ;
		InputMask = "999,999", ;	&& with "999999" the bug not appear
		Left = 61, ;
		Top = 47, ;
		Name = "Text1"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 46, ;
		Left = 186, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "captureFocus", ;
		Name = "Command1"

	PROCEDURE Load
		create cursor test (numeric N(8,0))
		append blank
		*replace numeric WITH 0  && with a not blank field the bug not appear
		? 'IS Blank',ISBLANK(numeric)
	ENDPROC


	PROCEDURE Text1.GotFocus
		KEYBOARD '5{TAB}' 		&& simulate a digit input with TAB lostfocus
	ENDPROC

ENDDEFINE
Manual repro:
- run
- press 5 -> one looks at that a zero appear to right
- press ENTER or TAB
PUBLIC oform1

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

DEFINE CLASS form1 AS form

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

	ADD OBJECT text1 AS textbox WITH ;
		Alignment = 3, ;
		ControlSource = "test.numeric", ;
		InputMask = "999,999", ;	&& with "999999" the bug not appear
		Left = 61, ;
		Top = 47, ;
		Name = "Text1"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 46, ;
		Left = 186, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "captureFocus", ;
		Name = "Command1"

	PROCEDURE Load
		create cursor test (numeric N(8,0))
		append blank
		*replace numeric WITH 0  && with a not blank field the bug not appear
		? 'IS Blank',ISBLANK(numeric)
	ENDPROC


*!*		PROCEDURE Text1.GotFocus
*!*			KEYBOARD '5{TAB}' && simulate a digit input with TAB lostfocus
*!*		ENDPROC

ENDDEFINE
Notes:
With a spinner, a similar problem appear;
this is not correlate with the blank or not blank status of the field, it is correlate with the InputMask only.

Fabio
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform