I like Palardy’s pushing me to Extends which I have never used in my code. Learned something by employing that.
But then things like Graphics.FillRectangle expect Doubles as Parameters.
If you do something as innocuous as Graphics.FillRectangle(0,0,20, 20)
you will get one of these “precision” warnngs.
Trying to avoid them becomes more trouble than it is worth, at least in the project that I am working with. I have 4,500 of this type of warning.
It is interesting that you can select all 4,500 warnings and copy them into a text editor like BBEdit if you wanted to play games like using Regex to find some “important” warnings in the haystack. When you paste, you actually get, as a bonus, the name of the method where the error occurs even though you do not see that in the highlighted text you are copying. Sort of cool.
[quote]winLogicError.BestWidth, line 52
Converting from Double to Integer causes a possible loss of precision, which can lead to unexpected results
totWidth = totWidth * LITTLE_EXTRA
winLogicError.BestWidth, line 53
Converting from Double to Integer causes a possible loss of precision, which can lead to unexpected results
goldenHeight = goldenHeight * LITTLE_EXTRA
RtrnString.rsPercent, line 11
Converting from Int32 to Double causes a possible loss of precision, which can lead to unexpected results
If denominator = 0 Then
RtrnString.rsPercent, line 14
Converting from Int32 to Double causes a possible loss of precision, which can lead to unexpected results
percent = (numerator * 100) / denominator
RtrnString.rsPercent, line 29
Converting from Int32 to Double causes a possible loss of precision, which can lead to unexpected results
Elseif percent < 1 Then
RtrnString.rsPercent, line 33
Converting from Int32 to Double causes a possible loss of precision, which can lead to unexpected results
Elseif percent < 3 Then
[/quote]