Writing bits

Blitz3D Forums/Blitz3D Programming/Writing bits

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ok, but you still can't clear it, can you?

I'd suggest to
Function SetBit(value, position, bit=1)
	If bit<>0
		Return value Or (1 Shl (position - 1))
	Endif
	Return value And ~(1 Shl (position - 1))
End Function 


Edit uh, you've edited yours :) so now it'S complete.

BTW - even I don't know (or forgot) about the "~" operator o_O. Truely black box technology.