
-----------------------------------
sarm2005
Tue Mar 11, 2008 12:50 pm

How do you write a loop that exits when any key is pressed?
-----------------------------------
well?

-----------------------------------
BigBear
Tue Mar 11, 2008 12:52 pm

Re: How do you write a loop that exits when any key is pressed?
-----------------------------------
First I am wondering if this has to be a loop. Input.Pause waits for input then continues the program. If this isn't what you are looking for please provide more information. Hope this helps.

-----------------------------------
sarm2005
Tue Mar 11, 2008 1:18 pm

Re: How do you write a loop that exits when any key is pressed?
-----------------------------------
Yeah. I need it to be a loop since I want something else to happen every so often if a key is not pressed.

-----------------------------------
Sean
Tue Mar 11, 2008 1:37 pm

Re: How do you write a loop that exits when any key is pressed?
-----------------------------------
Well, a simple if statement and an Input.KeyDown is required.

You want it to detect if a key was pressed then perform this action:


exit


It will exit when that certain button you assigned it to exit upon is pressed.

-----------------------------------
Mackie
Tue Mar 11, 2008 1:48 pm

RE:How do you write a loop that exits when any key is pressed?
-----------------------------------
loop
    % Do stuff
    exit when hasch
end loop

Easy way.

-----------------------------------
sarm2005
Tue Mar 11, 2008 1:58 pm

Re: How do you write a loop that exits when any key is pressed?
-----------------------------------
Ok. That works. Thank you.

-----------------------------------
Sean
Tue Mar 11, 2008 2:16 pm

Re: How do you write a loop that exits when any key is pressed?
-----------------------------------
Mackie, I wasn't trying to give it to him, was just trying to see if he could do it :P
