If (DeltaX = 0) And (DeltaY = 0) then begin x := x1; y := y1; end else If DeltaX = 0 then begin x := x1; y := y1 + STEP; end else If DeltaY = 0 Then begin y := y1; x := x1 + STEP; end else begin //Здесь размещается основной код end