Solved

C# operator

Posted on 2014-02-05
2
220 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
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Video Player 11 23
Graphics 2 27
Printing 1 51
Get distinct values from excel or comm seperated file 4 24
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…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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