PDA

View Full Version : Key fifo



longpole001
- 29th March 2014, 22:25
Hi guys , i having some trouble getting my head arround doing a fifo for keys , what i need is FIFO which goes upto 5 deep ,

so as progressively 5 keys are pressed , the array builds down , and the newest key is Key_array(0) , oldest is Key_array(4) , if key_value = 10 then clear the values from array

regards

longpole001
- 30th March 2014, 02:21
if key >0 then

for Key_count = 4 to 1 step - 1
Key_value(Key_count) = Key_value( Key_count - 1)
next Key_count

Key_Value(0) = Key
endif






this seems to work