
-----------------------------------
Sty1ez
Tue Jan 22, 2008 5:04 pm

Disabling Buttons After Use
-----------------------------------
Im kinda still a newbie to turing ......

I wanted to know how to disable a button after it is pressed since you can't put the disable button command in the procedure itself.

What im asking.. is there an alternate way of disabling a button since the disable command has to be after the button is created and the procedure comes before the button.

-----------------------------------
Gooie
Tue Jan 22, 2008 5:27 pm

Re: Disabling Buttons After Use
-----------------------------------
Use an array of boolean. Similarly to input. Set all the values to true with a for loop, and as the conditions are met set the key to false. There is probably a more elegant way of doing this. Just an Example.

var KeyOn : array char of boolean
var KeyInput : array char of boolean

for i : 1 .. upper (KeyOn)
    KeyOn (chr(i)) := true
end for

loop
    Input.KeyDown (KeyInput)
    if KeyInput ('w') and KeyOn ('w') then
        put "After all this suff is done disable the key"
        KeyOn ('w') := false
    end if
end loop


-----------------------------------
Sty1ez
Tue Jan 22, 2008 5:36 pm

Re: Disabling Buttons After Use
-----------------------------------
I dont understand arrays yet

and I was talking about a ------>GUI.CreateButtonGUI.CreateButton