FoxChart - Heigth/Width float Bug?? - Solution!

Topics: Bug Information, Enhancement Request
Mar 16, 2011 at 2:47 PM

Hi.

In the FoxChart class, I had a bizzard bug that I did not understand...  but I finally realize what it was.

I was calculating a graph outside of a form and was setting the Height and Width to the height and width of an other object and had unexpected result.  While the wanted size was 268*493, what I got was 4020*2465 (268x15 * 493x5 !).  I had to search for a long time because when I was manually setting the size (during debug) or setting them with fixed values in my code then it was working as expected.

This is when I tried to use the INT value of the height / width that I realized what was going on:  The properties Height and Width of my other class were not INT, but FLOAT and the FoxChart class was interpreting the float values in a weird manner.  You can reproduce the problem by setting the height / width to 268.0000000000 x 493.0000000000. 

To fix:  simply add an ASSIGN to the Height and Width of the FoxChart class that makes sure to set an INT value to the height and width.

Also:  I think there might be a memory leak with the FoxChart class.  In a normal usage, it might not be noticable.  But with the error I described here, the VFP was using something like 200 mb of uncleareble memory after each try (it is not long to use 1gb and more!)