
-----------------------------------
Kira
Tue Nov 06, 2007 10:38 pm

Sqauring Help &gt;&lt;
-----------------------------------
i wanted the calculation to continue until the number the user entered is met. but when i made the program, it didn't continue...but it stopped because the number is greater than the "maxrow"...is there a way that i could make it continue and stop until the number i wanted to end with?

here is my program:

 var number : int
var reply1, reply2 : string
loop
    put "Do you want to run program? (y/n) " ..
    get reply1
    exit when reply1 not= "y"
    put "Enter the number you wanted to stop at "
    get number
    cls
    locate (1, 1)
    put "Number"
    locate (1, 40)
    put "Sqaure"
    for i : 2 .. number
        delay (300)
        put i : 1
        locate (i, 40)
        delay (30)
        put i * i
        exit when i = number
    end for
    put "Do you want to try again? (y/n) " ..
    get reply2
    exit when reply2 not= "y"
    cls
end loop

-----------------------------------
Tony
Tue Nov 06, 2007 11:00 pm

RE:Sqauring Help &gt;&lt;
-----------------------------------
setting your application's window to a greater size should increase the value of maxrow.

-----------------------------------
Nick
Wed Nov 07, 2007 6:22 am

RE:Sqauring Help &gt;&lt;
-----------------------------------
instead of locating to i row instead locate to whatrow - 1 like so
var number : int
var reply1, reply2 : string
loop
    put "Do you want to run program? (y/n) " ..
    get reply1
    exit when reply1 not= "y"
    put "Enter the number you wanted to stop at "
    get number
    cls
    locate (1, 1)
    put "Number"
    locate (1, 40)
    put "Sqaure"
    for i : 2 .. number
        delay (300)
        put i : 1
        locate (whatrow - 1, 40)
        delay (30)
        put i * i
        exit when i = number
    end for
    put "Do you want to try again? (y/n) " ..
    get reply2
    exit when reply2 not= "y"
    cls
end loop


-----------------------------------
Kira
Wed Nov 07, 2007 4:11 pm

RE:Sqauring Help &gt;&lt;
-----------------------------------
ok thanks a lot guys!
