Meaning of "[Delegate]" ?

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
 
J

Jay B. Harlow [MVP - Outlook]

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
 
P

PseudoBill

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.
 

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

Top