Labels are a bit of a leftover from VB 6, IMO. The idea is being able to use
Goto statements to go to a specific label. For example:
Public Sub TestGoto()
Dim DataSetNumber As Integer = 1
RetrieveData:
Dim ds As DataSet = GetData(DataSetNumber )
For x = 1 to 100
'Assume if there is a "duck" then you go to retrieve data again
If ds.Tables[0].Rows[1]["Animal"] = "duck"
DataSetNumber += 1
Goto RetrieveData
End If
Next x
End Sub
This is a very bad example, as I can see no real use for labels any more,
but it illustrates that you can use it for flow control. In general, you
will find that proper architecture will not lead you to solutions where you
use labels.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
************************************************** ********************
Think Outside the Box!
************************************************** ********************
"Andreas Klemt" <ak******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello,
for what is the LABEL good when programming in visual studio like this:
Sub xxxx
Label1: xxxx
xxxx
xxx
Label2: xxxxx
End Sub
For what do I need or can use "Label1" and "Label2" in my Visual Studio
Code ?
Thanks for any help an answers in advance!
Andreas