Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: Spinner not force numeric type and VFP go in panic
Message
 
To
18/04/2004 13:29:51
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00895957
Message ID:
00895960
Views:
15
Hi Fabio,

... and under VFP 7.0 SP1 too.

Under VFP 5.0 SP3 AND VFP 6.0 SP5 not.

MartinJ

>If you bind a Variable/Property to a Spinner,
>you cannot initialize it to .NULL.
>
>Repro:
>
>PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>DEFINE CLASS form1 AS form
>
>
>	DoCreate = .T.
>	Caption = "Form1"
>	myproperty = .NULL.		&& VAL(.NULL.) is the workaround
>	Name = "form1"
>
>	ADD OBJECT spinner1 AS spinner WITH ;
>		Height = 24, ;
>		Left = 24, ;
>		Top = 14, ;
>		Width = 121, ;
>		ControlSource = "m.thisform.MyProperty", ;
>		Name = "Spinner1"
>
>
>	ADD OBJECT command1 AS commandbutton WITH ;
>		Top = 13, ;
>		Left = 156, ;
>		Height = 27, ;
>		Width = 84, ;
>		Caption = "Other focus", ;
>		Name = "Command1"
>
>
>	ADD OBJECT command2 AS commandbutton WITH ;
>		Top = 51, ;
>		Left = 29, ;
>		Height = 27, ;
>		Width = 84, ;
>		Caption = "Release", ;
>		BackColor = RGB(255,255,0), ;
>		Name = "Command2"
>
>
>	ADD OBJECT label1 AS label WITH ;
>		AutoSize = .T., ;
>		FontSize = 15, ;
>		Alignment = 2, ;
>		BorderStyle = 1, ;
>		Caption = "Press Esc To Force Exit", ;
>		Height = 26, ;
>		Left = 126, ;
>		Top = 53, ;
>		Width = 216, ;
>		ForeColor = RGB(255,0,0), ;
>		BackColor = RGB(255,255,0), ;
>		Name = "Label1"
>
>	PROCEDURE Unload
>		ON ERROR
>		ON KEY LABEL ESC
>	ENDPROC
>
>	PROCEDURE Load
>		* without next line you go into a panic status, and you must kill VFP
>		*ON ERROR MESSAGEBOX(MESSAGE())
>		* with ON ERROR you can close the window only with a CLEAR ALL
>		ON KEY LABEL ESC CLEAR ALL
>	ENDPROC
>
>	PROCEDURE command2.Click
>		* this is ignored
>		thisform.release
>		RELEASE WINDOWS (m.this.Name)
>	ENDPROC
>
>	PROCEDURE spinner1.InteractiveChange
>		WAIT WINDOWS VARTYPE(m.this.Value) NOWAIT NOCLEAR
>	ENDPROC
>
>	PROCEDURE spinner1.Destroy
>		WAIT WINDOWS CLEAR
>	ENDPROC
>	
>ENDDEFINE
>
>
>The cause:
>Spinner is a control with a hidden textbox object.
>When Spinner load the .NULL. ( logical ),
>the textbox show nullDisplay,
>but when you edit, the Value is numeric in InteractiveChange,
>but it write a string into the binded ControlSource property,
>and immediately after reload it
>(for a eventual update trigger) and fire the error of data type

>
>On code you can found the workaround.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform