-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tutorial "Enum" contains a mistake #72
Comments
I believe the documentation is correct, because that is how XOR works. The example describes using XOR to remove an enum from a set. |
Then it should possibly inform that "xor" is not simply "unsetting" ... it can have "side effects" (for not yet set flags). It acts as a "switch/flip" there. So maybe add an example (line in the sample) on how to remove something which "might" be set. |
But that's what is written in the Tutorial: ..means for me "For removing a flag use XOR" And this is wrong. XOR swaps the state, but does not remove. A clear "Removing" can only be done with the combination of AND and XOR. So why not writing:
I'm only reporting... you decide. Thats ok for me. |
you should write this as: |
typo: |
I read the chapter about ENUMs at your homepage:
https://blitzmax.org/docs/en/language/enums/
and found this:
Here you write that a XOR-operation removes a flag from the variable meetingDays. But this is only correct if the flag is already part of the variable. In cases, where the flag is not there this would cause a complete wrong result.The flag will be added:
The better operation is a combination of AND and XOR. This 100% removes a BIT from a variable:
The text was updated successfully, but these errors were encountered: