Dwayne...

---snip---

For example (maybe you could help me with this one...

IF (ABS(But1-1000))<50 Then But3=1 Else But3=0 EndIf

compiler says syntax error..

I have tried (it seems) every combination of parenthesis, but it still says syntax error. You know why?

---snip---

Two things here...

Firstly, endif is a command all on it's own, to be used when you break up an if-then-else statement onto separate lines...

IF (ABS(But1-1000))<50 Then
But3=1
Else
But3=0
EndIf

Also, you have an unnescessary set of brackets... try...

IF ABS(But1-1000)<50 Then

Finally, If it still errors, make sure you have correctly defined But1 and But3.

There's no code overhead penalty in using multiple lines within if-then-else statements and it makes code much more readable.

Melanie