Hello gentlemen,
When running a program, I get an overflow error. If I put a breakpoint on the offending line, the overflow errors cease.
The code is:
x_small = CDec(xavg - (scale_val / 1.9))
All the variables are variants (scale_val is a decimal) and have been declared as such.
When the prgram crashes, the debugger shows the following values:
xavg=-89.07735319
scale_val=2.16080000001284E-04
I have also tried x_small and xavg as doubles with the same error. Scale_val becomes zero if I make it a double, so I've used the cdec function to make it a decimal/variant.
Strangely, this error only occurs the second time through the snippet of code. The first time through (with the exact same values for all variables) it runs fine, if, however, I invoke this subroutine again, the overflow occurs.
I am using VB 5 for this project.
Thanks in advance,
Ryan
When running a program, I get an overflow error. If I put a breakpoint on the offending line, the overflow errors cease.
The code is:
x_small = CDec(xavg - (scale_val / 1.9))
All the variables are variants (scale_val is a decimal) and have been declared as such.
When the prgram crashes, the debugger shows the following values:
xavg=-89.07735319
scale_val=2.16080000001284E-04
I have also tried x_small and xavg as doubles with the same error. Scale_val becomes zero if I make it a double, so I've used the cdec function to make it a decimal/variant.
Strangely, this error only occurs the second time through the snippet of code. The first time through (with the exact same values for all variables) it runs fine, if, however, I invoke this subroutine again, the overflow occurs.
I am using VB 5 for this project.
Thanks in advance,
Ryan