Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is { } used for in vb.net 1

Status
Not open for further replies.

Nademic

Programmer
Mar 25, 2008
18
0
0
CA
Hi,

Was just reviewing some code from a MS book and something doesn't look right. First of all the system.drawing class is used but from the looks of things the code is being run in a console app. You can't draw inside a command prompt, you don't even get the system.drawing class inside a console app. Also was just wondering what the { } means in the code line below that reads ("Point X {0}, Y {1}", p.X, p.Y)".

Code:
Dim p As New System.Drawing.Point(20, 30)
' Move point diagonally
p.Offset(-1, -1)
Console.WriteLine("Point X {0}, Y {1}", p.X, p.Y)
 
It indicates a "placeholder"

[tt]Console.WriteLine("Point X {0}, Y {1}", p.X, p.Y)[/tt]

{0} means replace with the first parameter (after the comma)
{1} means replace with the second parameter (after the comma)


Hope this helps.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top