ich würd in nen sub machen:

Code:
Declare Sub Anmachen(byval Color As String * 10 , Byval Status As String * 4)




Call Anmachen("red", "an")




sub anmachen(byval color as string * 10 , byval status as string * 4)

Select Case color

   Case "red"

       if status = "an" then
         portb.1 = 1
       else
         portb.1 = 0
       end if

   Case "blue"

       if status = "an" then
         portb.2 = 1
       else
         portb.2 = 0
       end if

End Select

end sub
könnte kleinere fehler beinhalten habs nur eben "hingewurschtelt"

gruß bammel