?
Solved

C# operator

Posted on 2014-02-05
2
Medium Priority
?
223 Views
Last Modified: 2014-02-05
What is |=    and &=  equivalent to in vb.net?

const bool multiline = true;
int flags = doc.GetInfoInt(text.Id, "Ff");
if(multiline)
    flags |= 0x1000;        <<<< this line
else
    flags &= ~0x1000;     <<<< this line
doc.SetInfo(text.Id, "/Ff:Num", flags);
0
Comment
Question by:VBdotnet2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 2000 total points
ID: 39837107
When you use And, Or or Not between 2 values, the VB compiler analyzes the context. It will perform a logical (boolean) operation if the operator is used with Boolean values, a bitwise operation (as in your question) if the operators are integer values.

Another thing that you might need to also know is the representation of 0x1000 in VB is &H1000

Thus:

flags Or &H1000
flags And Not &H1000
0
 

Author Comment

by:VBdotnet2005
ID: 39837208
Excellent explanation.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question