How to select speed before set run direction...

Your first attempt at coding? You've never written code before?