Meaning of "[Delegate]" ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In the following VB.NET code, what is the meaning of "[Delegate]" ? Cannot find a reference for using "[]" 's. Thanks

Public Sub New(ByVal [delegate] As GetWeatherDelegate, ByVal cityQuery As String
Me.AsyncInvoker = [delegate
Me.CityName = cityQuer
End Sub
 
Tom,
"Delegate" is a keyword in VB.NET, using the [] in "[delegate]" allow the
keyword to be used as an identifier. "[delegate]" is an escaped
identifier...

For details on escaped identifiers see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbls7/html/vblrfVBSpec2_2.asp

Hope this helps
Jay

Tom_B said:
In the following VB.NET code, what is the meaning of "[Delegate]" ?
Cannot find a reference for using "[]" 's. Thanks.
Public Sub New(ByVal [delegate] As GetWeatherDelegate, ByVal cityQuery As String)
Me.AsyncInvoker = [delegate]
Me.CityName = cityQuery
End Sub
 
It's a "keyword override" - if you want to use a keyword as a variable
name, you surround it in square brackets. Very sloppy, but VB
encourages this sort of thing.
 
Back
Top