What am I missing??

Submitted by leehester on Wed, 12/02/2015 - 00:40

TB 6.007
Win 7 pro
AMD FX8350
ASUS 990FX

below is a program that displays the Mandelbrot set and allows you to recenter, zoom in and zoom out... I have not put in any niceties like instructions and I do have several "print" statements scattered around to print out some key values at different points for debugging.

My problem is this: after zooming in a few times, you can continue to zoom-in and it will dutifully find the new center, edges and so on, but will not actually draw the picture.

The problem appears to happen in the "drawit" subroutine. The logical window uses the coordinates of the part of the mandelbrot set we are currently observing. So, when you zoom in, the numbers can get small. For example, the leftmost x coordinate once when it stopped drawing was -0.15868566 and the rightmost x coordinate was -0.043158189. Since the number of pixels across the window was about 1900, that meant that in figuring out the status of each pixel, I was incrementing the x coordinate by 0.000060328185 each time. But the program didn't actually draw the picture. it appeared to skip straight past the nested for next loops that were supposed to step it through each x and y coordinate across the screen.

At first I thought perhaps Truebasic did not allow such small step increments and it just bypassed them. So I wrote a short program using "for x=-0.15868566 to -0.043158189 step 0,000060328185" and the program worked just fine counting through each iteration... So why is it not going through them in the program below???

Instructions if you want to test: After the opening screan is fully drawn, select "zoom in" from the menu and then position your mouse pointer where you want the center of the zoom to be and press the left mouse button. After that draws, repeat another 3 or 3 times and you will eventually see it start skipping past the drawing. It is still running, because you can use the menu to exit the program... but it is no longer making a picture.