
-----------------------------------
bushnerd
Tue Dec 27, 2005 9:21 pm

Please help me exit this loop
-----------------------------------
I am using the getch command and am trying to exit the loop when the box is clicked. Any idea what I am doing wrong, or how to improve this?



procedure playbox
    cls
    demonstrationintro
    var note : string (1)
    var xmouse, ymouse, button : int
    mousewhere (xmouse, ymouse, button)
    drawfillbox (275, 260, 335, 320, 4)
    locatexy (280, 245)
    put "Exit"
    loop

        getch (note)
        if note = "1" then
            note2C
        elsif note = "2" then
            note4C
        elsif note = "3" then
            note2D
        elsif note = "4" then
            note4D
        elsif note = "5" then
            note2E
        elsif note = "6" then
            note4E
        elsif note = "7" then
            note2G
        elsif note = "8" then
            note4G
        end if
        exit when xmouse >= 275 and xmouse = 260 and ymouse 