Solved

C# operator

Posted on 2014-02-05
2
216 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now