VB doesn't understand!

Started by
1 comment, last by Rad76 21 years, 9 months ago
Public Type tMan x as integer y as integer End Type Public Man as tMan Man.x = 1200.001 Man.y = 100 Text1.text = Man.x + Man.y Text1.text = 1300 Text1 for some reason leaves out the decimals!!! WHY?? Please help. Thanks
Advertisement
Your x and y variables within the structure are defined as integers. Define them as Single and you should get the result you expect. Otherwise, VB will truncate off your float assignments and convert them to integers.

Text1 isn't leaving out the decimal. Man.x is.

[edited by - Waverider on June 27, 2002 2:45:49 PM]
It's not what you're taught, it's what you learn.
Yep, it worked.

Thanks a lot

This topic is closed to new replies.

Advertisement