shown in fig5 flags f 1 and f 2 are reset as initialization sl1 then a subroutine of key input sl2 and a subroutine of driving the sewing apparatus 1 sl3 are repeated in this order the subroutine of the key input is executed as shown in fig6 first whether the flag f 1 is reset f 1 0 or not is judged s33 if the flag f 1 is set f 1 1 it means the execution key 32b is on and therefore the operation of the input key group 31 is prohibited while the sewing apparatus 1 is driven if the key 32b is reset the operation goes to s1 where whether either one of the stitch number increase decrease keys 31a is on is judged if none of the keys 31a is on whether either one of the cursor moving keys 31b is on is judged s2 if either one of the keys 31a is on the cursor is moved as commanded s3 if none of the keys 31b is on the operation goes to s4 in s4 whether either one of the pulse number increase decrease keys 31c is on is judged if either one of the keys 31c is on the thread pulse number displayed in the area 30b 30c or 30d is increased or decreased as commanded s5 if none of the keys 31c is on the operation goes to s6 in s6 whether the saving key 32a is on or not is judged if the key 32a is not on the operation returns to the main routine if the key 32a is on the thread.