Calculations differ between VB6 and VB7
I am converting a VB6 project to VB7 (.NET) and I have encountered some inconsistencies in the way the to platforms run calculations. The most significan is this. I have found that values calculate differently between VB6 and VB7.
Use the following line of code in either version and the values returned will differ.
VB6 Returns a 7
VB7 Returns a 6
It seems as if we have a pair of dyslexic twins here.
Has anyone else encountered similar differences, if so, how did you resolve them.
John Vonesh
Re: Calculations differ between VB6 and VB7
hI,
VB Code:
CInt(CDbl(13 / 60) * 30-.1)
returns 6 in VB6, so obviously, this combination of functions in VB6 does result in normal rounding.
Therefore it seems that VB6 produces a value expressed as an integer variable whilst VB.NET produces a true integer result.
Presumeably this was a little known bug in VB6 which has now been corrected.