For each item in list execute if statement

Hey. I'd like to use a textbox to move a sprite with instructions. For exemple if I put a,r,a,r,r in the textbox the sprite will move forward then backward (in the exact same order I wrote) ... (a = forward, r = backward). I decided to use the for each item in list loop to make sure whenever the item var is equal to a the sprite is moving forward and when it is equal to r, the sprite is moving backward. But currently it isn't working as I want, like the sprite is only moving with the last instruction given. For ex, with a,r,a,r,r,r,a it will only move the sprite with the last instruction given (in italic). I don't know what to do because I usually work with Python and this type of loop is perfectly working. I tried my best to be as precise as I could (my english is pretty bad). I will be very grateful to receive any help :).

You need a Clock Timer and a global list to feed it one item at a time.

Looping will not help you here

Search this board for my Morse code demo.