
-----------------------------------
MattehMatt
Fri Oct 31, 2008 6:15 pm

Help with making script continue on KeyDown.
-----------------------------------
Alright, well I'm making small programs for assignments for school, I have the basics down and could probably ace the marking but I feel like going above and beyond.
What I'm trying to get work is for the program to ask if you want to restart the program and if the user answers yes to say something like "Press Enter to Continue", and when the enter key is pressed for the program to restart itself.

Any help would be appreciated.
Here's the scripting I've got done so far.


var name1, name2, name3, name4, name5 : string
var reply : string
var chars : array char of boolean


setscreen ("graphics:max;max")
loop

    put "Enter five full names, please seperate each by a line. (Press Enter)"
    get name1 : *
    get name2 : *
    get name3 : *
    get name4 : *
    get name5 : *
    put skip
    put "Now watch how these names are rearranged to be backwards!"
    put name5
    put name4
    put name3
    put name2
    put name1
    put "ITS MAGIC!"
    put "Do you want to flip around more names? Y/N   "
    get reply
    exit when reply = "n" or reply = "N"
    if reply = "y" or reply = "Y" then
        put "Ok then! Press then down arrow when you want to start over!"
        delay (100)
        loop
            Input.KeyDown (chars)
            if chars (KEY_DOWN_ARROW) then
                locate (19, 1)
                put "And here we go again!"
                delay (100)
                cls
            end if
        end loop

    end if
end loop

-----------------------------------
Insectoid
Fri Oct 31, 2008 10:16 pm

RE:Help with making script continue on KeyDown.
-----------------------------------
get a variable. If it = 'yes' the do nothing. If it equals 'no' then exit the loop.

-----------------------------------
MattehMatt
Sat Nov 01, 2008 2:42 pm

Re: Help with making script continue on KeyDown.
-----------------------------------
Thanks for that, instead I used a process with getch thanks tho :)

-----------------------------------
ecookman
Sat Nov 01, 2008 4:18 pm

RE:Help with making script continue on KeyDown.
-----------------------------------
turing=more than one solution... isn't it wonderful :)
