Why is ++xy not considered a syntax error?

  • Thread starter Thread starter Emilio
  • Start date Start date
E

Emilio

Dim xy As Integer
xy = 1
MsgBox(++xy)

Why is ++xy not considered a syntax error. Does it do anything?
(it doesn't increment xy, as c# programmers might expect)
 
Emilio said:
Dim xy As Integer
xy = 1
MsgBox(++xy)

Why is ++xy not considered a syntax error. Does it do anything?
(it doesn't increment xy, as c# programmers might expect)

'++' is treated as sign, '-+1' will result in -1, '--1' will result in 1.
 
Emilio,
I should add, that Paul Vick's "The Visual Basic .NET Programming Language"
from Addison Wesley is a good (right size, right content) desk reference to
the VB.NET language itself. Paul's book covers just the language, not the
framework.

Hope this helps
Jay
 
Jay B. Harlow said:
Emilio,
I should add, that Paul Vick's "The Visual Basic .NET Programming Language"
from Addison Wesley is a good (right size, right content) desk reference to
the VB.NET language itself. Paul's book covers just the language, not the
framework.

O.k. thanks, I know the language by en large, you don't normally
stumble on those things unless you are trying to convert from c# to
vb. At the moment I can't see anything which is better in c# than
it is in vb, so I'll stay with vb.
 

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