473,386 Members | 1,810 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,386 software developers and data experts.

-= Operator

Hi to all, I have been desperatly trying to find out what the -=
operator does. The funny thing is that Google doesn't allow -= in its
queries, so it's hard to find...
Aug 24 '07 #1
6 1361
"Thorsten Adams" <th**************@hotmail.comwrote in message
news:uy**************@TK2MSFTNGP04.phx.gbl...
Hi to all, I have been desperatly trying to find out what the -= operator
does. The funny thing is that Google doesn't allow -= in its queries, so
it's hard to find...
For example

Dim i as integer = 66
dim j as integer = 33

i -= 22 ' which is same as i = i - 22
j += 33 ' which is same as j = j + 33

' i now = 44
' j now = 66
--
regards,
Les Hay, Livingston, Scotland

Aug 24 '07 #2
Super, thank you, Les!
Regards,
Thorsten
Aug 24 '07 #3
as addition to Les Hay
These operators are often found in loop constructs

dim i as integer
do while blabla

i+=1 ( corresponds to i = i + 1)
i-=1 ( corresponds to i = i - 1)

Loop

it just saves you some typing

regards

Michel
"Thorsten Adams" <th**************@hotmail.comschreef in bericht
news:%2****************@TK2MSFTNGP04.phx.gbl...
Super, thank you, Les!
Regards,
Thorsten

Aug 25 '07 #4
"Michel Posseth [MCP]" <ms****@posseth.comha scritto nel messaggio
news:%2****************@TK2MSFTNGP02.phx.gbl...
These operators are often found in loop constructs

dim i as integer
do while blabla

i+=1 ( corresponds to i = i + 1)
i-=1 ( corresponds to i = i - 1)

Loop

it just saves you some typing
In loops is better again

i++
i--

for (int i = 0; i < 10; i++)

:)
--
Help The New .Net Site! http://www.devbox4.net
Aug 25 '07 #5
On Sat, 25 Aug 2007 23:52:22 +0200, "Fabio" <zn*******@virgilio.it>
wrote:
>"Michel Posseth [MCP]" <ms****@posseth.comha scritto nel messaggio
news:%2****************@TK2MSFTNGP02.phx.gbl...
>These operators are often found in loop constructs

dim i as integer
do while blabla

i+=1 ( corresponds to i = i + 1)
i-=1 ( corresponds to i = i - 1)

Loop

it just saves you some typing

In loops is better again

i++
i--

for (int i = 0; i < 10; i++)

:)
But that is C syntax, not VB. VB doesn't have ++ and --.
Aug 25 '07 #6
"Jack Jackson" <ja********@pebbleridge.comha scritto nel messaggio
news:cg********************************@4ax.com...
>
But that is C syntax, not VB. VB doesn't have ++ and --.
Acc... you're right :P
It's a C# syntax (and all others languages except VB :P )

--
Help The New .Net Site! http://www.devbox4.net
Aug 26 '07 #7

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

Similar topics

7
by: Paul Davis | last post by:
I'd like to overload 'comma' to define a concatenation operator for integer-like classes. I've got some first ideas, but I'd appreciate a sanity check. The concatenation operator needs to so...
1
by: joesoap | last post by:
Hi can anybody please tell me what is wrong with my ostream operator??? this is the output i get using the 3 attached files. this is the output after i run assignment2 -joesoap #include...
5
by: Jason | last post by:
Hello. I am trying to learn how operator overloading works so I wrote a simple class to help me practice. I understand the basic opertoar overload like + - / *, but when I try to overload more...
0
by: Martin Magnusson | last post by:
I have defined a number of custom stream buffers with corresponding in and out streams for IO operations in my program, such as IO::output, IO::warning and IO::debug. Now, the debug stream should...
3
by: Sensei | last post by:
Hi. I have a problem with a C++ code I can't resolve, or better, I can't see what the problem should be! Here's an excerpt of the incriminated code: === bspalgo.cpp // THAT'S THE BAD...
6
by: YUY0x7 | last post by:
Hi, I am having a bit of trouble with a specialization of operator<<. Here goes: class MyStream { }; template <typename T> MyStream& operator<<(MyStream& lhs, T const &)
3
by: gugdias | last post by:
I'm coding a simple matrix class, which is resulting in the following error when compiling with g++ 3.4.2 (mingw-special): * declaration of `operator/' as non-function * expected `;' before '<'...
5
by: raylopez99 | last post by:
I need an example of a managed overloaded assignment operator for a reference class, so I can equate two classes A1 and A2, say called ARefClass, in this manner: A1=A2;. For some strange reason...
8
by: valerij | last post by:
Yes, hi How to write "operator +" and "operator =" functions in a class with a defined constructor? The following code demonstrates that I don't really understand how to do it... I think it has...
3
by: y-man | last post by:
Hi, I am trying to get an overloaded operator to work inside the class it works on. The situation is something like this: main.cc: #include "object.hh" #include "somefile.hh" object obj,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.