Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Divide in the value of a text box
Message
De
19/10/2004 10:49:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00952624
Message ID:
00952628
Vues:
7
This message has been marked as the solution to the initial question of the thread.
That looks as if the TxtBox.Value is of a type that is not numeric, probably character.

You can check the type of a TxtBox.Value with the type() or vartype() functions.

You can force the type to be numeric by explicitly initializing it, either in the Property Sheet (assign the value 0 to the .Value property), or in some Init() (in the TextBox itself, or in the Form).

HTH,

Hilmar.

>I need to do some calculations for the screen only. I have put a text box on the screen and add or substract values fine. Once I try divide I get a data type mismatch error.
>
>thisform.total.value = thisform.txtbox1.value + thisform.txtbox2.value works fine.
>thisform.total.value = thisform.txtbox1.value / thisform.txtbox2.value gets data type mismatch error.
>
>I have even tried using variables to do the math then display in the text box, still no luck.
>
>My data is in an array, do I have to add the value from there then display in my text box....
>
>Thanks.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform