NewTool=GetSelectedTool()OldTool=GetCurrentTool()MaxToolNum=8Aaxis=3Plus=0Minus=1While NewTool>MaxToolNum Or Newtool<1      NewTool=Question("Geef een nieuw gereedschap tot maximaal"& MaxToolNum)Wend If NewTool=Oldtool ThenMsgBox"gekozen gereedschap is al geladen"End IfIf OldTool<>NewTool Then While Tool <> NewTool  JogOn(Aaxis,Plus) If isactive(Input1)And isactive(Input2)And isactive(Input3)And Not isactive(Input4) Then    Tool=1    End If If isactive(Input1)And isactive(Input2)And Not isactive(Input3)And Not isactive(Input4) Then    Tool=2    End If If isactive(Input1)And Not isactive(Input2)And Not isactive(Input3)And Not isactive(Input4) Then    Tool=3    End If If Not isactive(Input1)And Not isactive(Input2)And isactive(Input3)And isactive(Input4) Then    Tool=4    End If If isactive(Input1)And Not isactive(Input2)And isactive(Input3)And isactive(Input4) Then    Tool=5    End If If isactive(Input1)And Not isactive(Input2)And Not isactive(Input3)And isactive(Input4) Then    Tool=6    End If If isactive(Input1)And isactive(Input2)And Not isactive(Input3)And isactive(Input4) Then    Tool=7    End If If isactive(Input1)And Not isactive(Input2)And isactive(Input3)And Not isactive(Input4) Then    Tool=8    End If   Wend  JogOff(Aaxis)End If SetOEMDRO(824,Newtool)While IsMovingWend Code"M12"  End                   