473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

VB-101 Using "&=" operator

When displaying output in a MessageBox, using a variable Output as string,
the &= operator is used instead of the = operator. In which cases is the &=
operator used?
Nov 21 '05 #1
8 1505
"John Pass" <Jo******@discussions.microsoft.com> schrieb:
When displaying output in a MessageBox, using a variable Output as string,
the &= operator is used instead of the = operator. In which cases is the
&=
operator used?


'&=' is a shortcut operator:

\\\
s = s & "Foo"
///

is semantically equivalent to

\\\
s &= "Foo"
///

Note that some other shortcut operators like '+=', '*=', etc. exist too.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
Thanks for your reply Herfried,

I had used the other but not yet this shortcut operator &=.
I now also see that it is used to incorporate the old output into the new
output, since it otherwise would have gone lost. So it makes sense to use the
shortcut operator &= here.

Regards,

"Herfried K. Wagner [MVP]" wrote:
"John Pass" <Jo******@discussions.microsoft.com> schrieb:
When displaying output in a MessageBox, using a variable Output as string,
the &= operator is used instead of the = operator. In which cases is the
&=
operator used?


'&=' is a shortcut operator:

\\\
s = s & "Foo"
///

is semantically equivalent to

\\\
s &= "Foo"
///

Note that some other shortcut operators like '+=', '*=', etc. exist too.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
All these simple 'operator' questions are in you built in MSDN Documentation

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #4
"Crouchie1998" <cr**********@spamcop.net> schrieb:
All these simple 'operator' questions are in you built in MSDN
Documentation


ACK. Simply place the caret over the '&=' in the IDE's text-editor and
press the F1 key :-). That's much easier than opening up the news client
and typing a question, waiting for the replies, ...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5
I used to use that method in the old VB 6 days because it was quicker to
highlight what you needed to find then type it in But with the above method,
Herfried you may get the 'text under the cursor isn't recognised', error.

Another way is to highlight it & click on the dynamic help. Normally if its
listed it will be at the top of the list.

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #6
Crouchie,

"Crouchie1998" <cr**********@spamcop.net> schrieb:
I used to use that method in the old VB 6 days because it was quicker to
highlight what you needed to find then type it in But with the above
method,
Herfried you may get the 'text under the cursor isn't recognised', error.
For operators, it seems to work, but I agree that it doesn't work under all
circumstances.
Another way is to highlight it & click on the dynamic help. Normally if
its
listed it will be at the top of the list.


ACK. There are so many ways, but posting to the group is one of the most
complicated ones.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #7
Excuse my ignorance, Herfried, but what does ACK mean?

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #8
"Crouchie1998" <cr**********@spamcop.net> schrieb:
Excuse my ignorance, Herfried, but what does ACK mean?


ACK = acknowledged :-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical)...
17
by: Andreas Huber | last post by:
What follows is a discussion of my experience with .NET generics & the ..NET framework (as implemented in the Visual Studio 2005 Beta 1), which leads to questions as to why certain things are the...
16
by: Boni | last post by:
Dear all, Is there any perfomance difference in string concatination using "+" vs "&"? I think, that compiler produces the same code for both. Am I right? Thank you, Boni
3
by: david | last post by:
I do not how to include char & in a string. In C, use \&. But I do not know how in VB.NET? any one give me hand? I have the following error message. David ...... Syntax error: Missing...
12
by: Domac | last post by:
What is the difference between "+" and "&" operator when joining strings? Thanx!
39
by: dancer | last post by:
Can somebody tell me why I get this message with the following code? Compiler Error Message: BC30452: Operator '&' is not defined for types 'String' and 'System.Web.UI.WebControls.TextBox'. ...
5
by: joso | last post by:
public static bool isodd(int i) { return ((i & 1) == 1); } can someone explain me how this is working
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.