473,698 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1519
"John Pass" <Jo******@discu ssions.microsof t.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******@discu ssions.microsof t.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
"Crouchie19 98" <cr**********@s pamcop.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,

"Crouchie19 98" <cr**********@s pamcop.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
"Crouchie19 98" <cr**********@s pamcop.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
2612
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) stuff. The class will behave like a std::vector (copy constructor and assignment create a deep copy), but with 2D indexing. Now I also need a 'view' class that will behave like a reference to an 'image' (can only be constructed from an existing...
17
3318
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 way they are. ***** Summary & Questions ***** In a nutshell, the current .NET generics & .NET framework make it sometimes difficult or even impossible to write truly generic code. For example, it seems to be impossible to write a truly generic
16
1321
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
1931
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 operand after ''&''prot='' operator. Description: An unhandled exception occurred during the execution of the
12
1251
by: Domac | last post by:
What is the difference between "+" and "&" operator when joining strings? Thanx!
39
4707
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'. <html> <head> <% @Import Namespace="System.Web.Mail" %>
5
2855
by: joso | last post by:
public static bool isodd(int i) { return ((i & 1) == 1); } can someone explain me how this is working
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8862
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.