Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Divide in the value of a text box
Message
From
19/10/2004 10:49:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00952624
Message ID:
00952628
Views:
6
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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform