
-----------------------------------
xevious
Sun Nov 13, 2005 11:30 am

Input + when statement?
-----------------------------------
First off, I can't get keydown to work at all.
I took this straight from the examples, and it won't work

var chars : array char of boolean
Input.KeyDown (chars)
if chars ('t') then
    put "The T key is pressed"
end if

Is there something wrong with that? 

I was also wondering if it is possible to combine some form of input with a when statement.

something like 
if chars ('t') when x=300 then *do something*



[/code]

-----------------------------------
MysticVegeta
Sun Nov 13, 2005 11:37 am


-----------------------------------
you need it in a loop

-----------------------------------
xevious
Sun Nov 13, 2005 11:46 am


-----------------------------------
you need it in a loop

ok thanks, I have that working now

but is there any way to put a when statement in that loop so it only does something when you press the button at a specific time?

-----------------------------------
Cervantes
Sun Nov 13, 2005 12:19 pm


-----------------------------------
if chars ('t') and x = 300 then
Or perhaps,
if chars ('t') and x >= 300 then

-----------------------------------
MysticVegeta
Sun Nov 13, 2005 12:49 pm


-----------------------------------
at a specific time?

you mean at a specific location right?

-----------------------------------
Tony
Sun Nov 13, 2005 1:33 pm


-----------------------------------
but is there any way to put a when statement in that loop
when statement doesn't actually have anything to do with time. It's a condition much like if, just different syntax.


function() when condition = true

is equavalent and will behave identical to

if condition = true then
    function()
end if


-----------------------------------
xevious
Sun Nov 13, 2005 2:38 pm


-----------------------------------
you mean at a specific location right?

yeah, that's what I meant, and I'll mess around with

if chars ('t') and x >= 300 then

I think I can get it to work...
