
-----------------------------------
WooFerPPK
Tue Oct 01, 2002 7:01 am

times table
-----------------------------------
i have to make a program that displays a time table, now i need it to count from 12 to 1. i got this so far

var gnumber : real  
put "Please enter the number"
get gnumber


for decreasing times : 12 .. 1
    locate (times, 1)
    put times, " * ", gnumber, " = ", times * gnumber
    delay (100)
end for


now i instead of it going like this
1
2
3

i want the numbers to go down like this
3
2
1

what am i doing worng?

-----------------------------------
Tony
Tue Oct 01, 2002 9:14 am


-----------------------------------
well here's your problem:
locate (times, 1)

since you count downwards then it will first print on 12th line and go up.

what you can do is to set up a separate counter that will add 1 every time for loop starts.

for decreasing times : 12 .. 1 
line := line +1
    locate (line, 1) 
    put times, " * ", gnumber, " = ", times * gnumber 
    delay (100) 
end for 


-----------------------------------
WooFerPPK
Tue Oct 01, 2002 11:32 am


-----------------------------------
Thanks again tony
