Um... well the first thing I noticed is that it's Endif not End If... That'd call the End command and terminate your program. Same thing with Endfunction. Also, if you're doing it like this:
If
Stuff
Endif
There should be no 'then'. 'then' should only be used if it's like this:
If Then Stuff (no endif)
So properly, that code is:
If (value = Not 0)
P = (P And &HFD)
Else
P = (P Or &H2)
Endif
If ((value And &H80) = &H80)
P = (P Or &H80)
Else
P = (P And &H7F)
Endif
Endfunction
--Mouse: Famous (Avatarless) Fighting Furball
Read It: http://www.angryflower.com/itsits.gif
Learn It: http://www.angryflower.com/bobsqu.gif