Procedure changedir; begin if keypressed=true then begin if direct=1 then begin case readkey of '2': direct:=2; '5': direct:=4; end; etc etc