VB-101 Using "&=" operator

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
John Pass said:
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.
 
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,
 
All these simple 'operator' questions are in you built in MSDN Documentation

Crouchie1998
BA (HONS) MCP MCSE
 
Crouchie1998 said:
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, ...
 
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
 
Crouchie,

Crouchie1998 said:
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.
 
Excuse my ignorance, Herfried, but what does ACK mean?

Crouchie1998
BA (HONS) MCP MCSE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top