|Subject:||RE: general question about variables|
|Date:||Fri, 19 May 2006|
> I can't for the life of me get this line of code to work:
> deltaX = .01
> When I go to the immediate window I find deltaX = 0
> [....] BTW the variable deltaX has been dimensioned as LONG
That is precisely your mistake. Type long is an integer type.
When you assign a floating-point value to an integer type, the
value is rounding (apparently using banker's rounding! :-<) to
integer value. Either declare deltaX as a floating-point type,
e.g. double, or do not declare its type at all, which some
people consider "poor form".
general question about variables posted by integreat on Fri, 19 May 2006