Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TxtBox doesn't allow full length of field
Message
De
23/06/2005 13:41:59
 
 
À
23/06/2005 13:23:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
01025919
Message ID:
01025953
Vues:
17
>>>>>>hello everybody.
>>>>>>
>>>>>>ok, here's one i havn't noticed before: i have a dbf with a double field (8,8). on the form i have a textbox (i used the basic textbox from VFP to eliminate any errors in the code of my txtbox class). this txtBox does not contain any code or any specs in the format and imputMask property.
>>>>>>
>>>>>B(8,8) or N(8,8) ? both are wrong
>>>>>
>>>>><snip>
>>>>
>>>>
>>>>- well, on the double type field (not "B" as you stated) you only specify the "nPrecision" with i set at 8, the "nFieldWidth" is showing 8.
>>>>
>>>>- the numeric field - you are correct - was 8,7 not 8,8
>>>
>>>Gunnar, want you a data or a display precision ?
>>>
>>>clear
>>>CREATE CURSOR myCursor (myField  B(8)) && double type field 8
>>>APPEND BLANK
>>>REPLACE myField  WITH 0.123456781
>>>? "myField  =",myField
>>>? "myField  =0.12345678"	,myField  =0.12345678
>>>? "myField  =0.123456781"	,myField  =0.123456781
>>>
>>
>>hello Fabio
>>
>>the problem is not the table (field) itself, but the capability to enter a absolute (like 12345678.00000000) into the textbox, it doesn't let me do it.
>>
>>to replace myfield with 12345678.00000000 - works just fine. my problem is a GUI problem.
>
>First, 16 digits go out of double precision,
>hovewer,
> i'm able to put 12345678.00000000 into a textbox binded to a double data field.


ok try this (in VFP 6), enter a value of 12345678.0 - what you'll get/see is 123.45678 :
MyForm = CREATEOBJECT("MyForm")
MyForm.VISIBLE = .T.

READ EVENTS

MyForm = .null.


* ***
DEFINE CLASS MyForm AS FORM
	AUTOCENTER	= .T.
	HEIGHT		= 200
	WIDTH			= 200

	ADD OBJECT MyTextBox AS TEXTBOX WITH ;
		TOP				= 20, ;
		LEFT				= 20, ;
		WIDTH				= 100, ;
		SELECTONENTRY	= .T., ;
		enabled			= .t., ;
		readonly			= .f., ;
		CONTROLSOURCE	= "MyCursor.MyField"

	PROCEDURE LOAD
		CREATE CURSOR MyCursor (MyField  B(8)) && double type field 8
		append blank
	ENDPROC

	PROCEDURE DESTROY
		USE IN MyCursor
		CLEAR EVENTS
	ENDPROC

ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform