Labels

Tuesday, August 31, 2010

Using Reserved Words in VB.Net

Up until now, if I wanted to use a reserved keyword as a variable, function or property name (such as Public Property ReadOnly() As Boolean), the compiler would complain.

Luckily I happened across a very simple answer yesterday; VB.Net works in a similar way to SQL - to use a reserved word as an identifier, just put square brackets around it!

i.e. Public Property [ReadOnly]() As Boolean

No comments:

Post a Comment