Bug? Serious Bug in 3.0

MrKim

Well-Known Member
Licensed User
Longtime User
For some reason in the new version Decimal numbers are being ignored when used for math. I don't believe it worked this way in the old version. This happens with EditText Views that are added using designer, I haven't tested with Views added at runtime. The Views are setup as Input Type DECIMAL_NUMBERS. Pseudo code below describes the problem.

Dim X as Float, Y as Float

'Ignores Decimal when doing math
EditText1.Text = .8
X = 60 * EditText1.Text 'X = 0
EditText1.Text = 1.8
X = 60 * EditText1.Text ' X = 60

'This works
EditText1.Text = .8
Y = EditText1.Text
X = 60 * Y 'X = 48
EditText1.Text = 1.8
Y = EditText1.Text
X = 60 * Y 'X = 108

I have other EditTexts where the .Text Value is Divided (EditText1.Text/60) that appears to work fine.

As to specific code:
This line fails as shown above when ActHrs.Text contains a decimal.
X = (60 * ActHrs.Text) / (Nz(ActTodaytb.Text, 0) + Nz(RejectQty.Text, 0))

In a separate routine ActTodaytb.Text can be a decimal and works fine.
X = ((Nz(NewCycleTime.Text, 0)) / 60) * (Nz(ActTodaytb.Text, 0) + Nz(RejectQty.Text, 0))

The Nz has no impact, NZ(ActHrs.Text, 0) above returns the same result.
 
Last edited:

MrKim

Well-Known Member
Licensed User
Longtime User
Erel,

OK, thanks. I thought I tested it with Release Compile but maybe not.
Small price to pay. 3.0 is amazing.

Kim
 
Top