As seen in the following recipe, the |= operator is used. I’ve never seen it before, and it’s not documented. What does it mean?
As seen in the following recipe , the |= operator is used. I’ve never
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the particular recipe you’re asking about:
dwFlagsis a bitmask, that is, it stores a number of flags in a single integer value by turning on the appropriate bits in the integer. In this case,STARTF_USESHOWWINDOWhas a value of1, which means that this flag is set if the least significant bit in thedwFlagsinteger is1, and is not set if the LSB is0.What the
|=operator does in this case is to take the left operand and change it so the1bits in the left operand are set in it, and the rest of the bits are left alone.For example, if it has some flags set such that it’s binary representation before was, say,
00101000, it will be set to00101001, addingsubprocess.STARTF_USESHOWWINDOWto the flags that are set without affecting the other flags that were set before the operation.