What's the opposite of "|"?

BlitzMax Forums/BlitzMax Programming/What's the opposite of "|"?

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.

http://www.blitzbasic.com/Community/posts.php?topic=77276#864589

Use the '~' operation, 'Flags:~ FLAG_THREE'.

(You can also use integers for flags and flag holders)
SuperStrict

Framework BRL.StandardIO

Const FLAG_ONE:Byte = 1, FLAG_TWO:Byte = 2, FLAG_THREE:Byte = 4, FLAG_FOUR:Byte = 8, FLAG_FIVE:Byte = 16

Local Flags:Byte = 0

'Add a flag to a variable
Flags:| FLAG_THREE

'Check if a variable contains a flag
If Flags & FLAG_THREE Then Print "Hello, flag three!"

'Remove a flag from a variable
Flags:~ FLAG_THREE

'Check if a variable contains a flag (again...)
If Flags & FLAG_THREE
	Print "Hello, flag three!"
	
Else
	Print "Flag three has left! :("
	
End If

Flags:| FLAG_ONE | FLAG_TWO | FLAG_THREE

'Invert flags
Local Flags_Inverted:Byte = ~Flags

If Flags_Inverted & FLAG_ONE Then Print "ONE is here!"
If Flags_Inverted & FLAG_TWO Then Print "TWO is here!"
If Flags_Inverted & FLAG_THREE Then Print "THREE is here!"
	
If Flags_Inverted & FLAG_FOUR Then Print "FOUR is here!"
If Flags_Inverted & FLAG_FIVE Then Print "Five is here!"