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

Why is ++xy not considered a syntax error?

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)
Nov 21 '05 #1
4 798
"Emilio" <[void]> schrieb:
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.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #2
Emilio,
Because plus (+) can be either a unary or a binary operator, you simply
applied the unary plus operator to xy twice. In other words you did:

MsgBox(+(+(xy)))

http://msdn.microsoft.com/library/de...Spec11_4_1.asp

"The unary plus operator results in the value of the operand"

Hope this helps
Jay
"Emilio" <[void]> wrote in message
news:Ok**************@TK2MSFTNGP11.phx.gbl...
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)

Nov 21 '05 #3
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

"Emilio" <[void]> wrote in message
news:Ok**************@TK2MSFTNGP11.phx.gbl...
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)

Nov 21 '05 #4

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:Ox****************@tk2msftngp13.phx.gbl...
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.


Hope this helps
Jay

"Emilio" <[void]> wrote in message
news:Ok**************@TK2MSFTNGP11.phx.gbl...
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)



Nov 21 '05 #5

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

Similar topics

9
by: rhmd | last post by:
I need to create image files (eg bmp or jpeg) of xy scatter graphs (i.e., graphs in which markers denote individual points; the markers need to be small polygons of various sizes, shapes, colors,...
25
by: mike420 | last post by:
Ladies and Gentlemen, I present to you the final and ultimate proof of Python's brain-damage: As you may remember, flist = for i in range(3)
1
by: steeve.nadeau | last post by:
Hi I search algorithme to convert XY into Latitude/longitude to use customer data with GPS... thk in advance.
61
by: Steven T. Hatton | last post by:
Stroustrup's view on classes, for the most part, seems to be centered around the notion of invariants. After a bit of adjusting to the use of yamt (yet another math term) in computer science, I...
6
by: Carlos | last post by:
I need to find a XY grpah sample to run in a asp.net web page Does anyone know where I can find one Thanks
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
1
by: milbrand | last post by:
I have an IFrame: <IFRAME id="BIssues" title="issues" src="BIssues.aspx" frameBorder="no"style="position:absolute;width:100%;height: 150px;border:0px"> In this iframe I have onmouseover that...
0
by: Phil Stanton | last post by:
Is there any way of putting labels against points in an XY Scatter graph. I know in Excel, using Rob Bovey's free addin http://www.appspro.com/Utilities/ChartLabeler.htm it is simple to do, but if...
1
by: Roger Blickensderfer | last post by:
I made an embedded xy chart with ChartWizard on Excel and would now like to modify the graph with VisualBasic. I would like to plot a set of xy points individually (not all at once) so that the...
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: 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
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...
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...

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.