RE: general question about variables

Giganews Newsgroups
Subject: RE: general question about variables
Posted by:  joeu20…
Date: Fri, 19 May 2006

"integreat" wrote:
> 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".



In response to

general question about variables posted by integreat on Fri, 19 May 2006