le 13/03/2009 @ 09:55 par Gary
|
I am in the middle of a program that solves triangles. So far every thing is working properly except for one little issue that is driving me crazy. First, there is a lot of calculations being done and they are working properly. I have it set up so the result is printed on a triangle I drew on the screen. The triangle on the screen is static, but the results have to move around a little to fit. For example, the results are printed on the screen in fraction form not decimal. Sometimes the result is in the form 3 ½ and sometimes it's just 3, so I need to move the printed number just a little to keep it in position.
The problem I am having is when the number is a fraction like 3 ½ it prints ok, but if it comes out to just 3 it prints it fine, but when it finishes printing it moves a different number that's in a different position and moves it out of it's original position.
When the calculations are done it leaves the number in decimal form and I have a sub procedure that takes the decimal number and turns it into a fraction like 3.5 decimal would turn into 3, 1, 2 and those numbers gets printed to the screen like this 3 ½ .
I am using sub procedures with all the printing, for example: GOSUB print_rise GOSUB print_run GOSUB print_hyp When I enter 3 into RISE and 4 into the RUN then it prints 5 into HYP, but when the RUN turns out to be a single number like 4 it react kind of weird. It prints the 5 into the HYP properly, but moves the 4 that is already printed in RUN to a different position. How can that happen when I didn't call the print_run sub procedure? I calculated the HYP from the RISE and RUN and then I call GOSUB print_hyp.
It's been driving my nuts the only thing different in the way it prints a fraction like 3 ½ and 3 is it moves the 3 forward a little. It seems to pass all the variables properly and calculates perfectly.
Anybody else have anything like this happen?
I do have a lot of A=this and B=that and C=A+B and I do use the A's, B's and C's multiple times, but they are always redefined in each sub procedure.
Gary
|