Re: what [] means?

From: Armin Zingler (az.nospam_at_freenet.de)
Date: 04/14/04


Date: Wed, 14 Apr 2004 16:08:43 +0200


"A.M" <IHateSpam@sapm123.com> schrieb
> Hi,
>
> I am analysing a VB.NET code and i see this line of code:
> Dim strCacheKey As String = [ProviderType] & "provider"
>
>
>
> What is the role of [ ] ?

None, if it works without [ ].

[ ] is only required if you use keywords as an identifier.

For example, "MyClass" is a keyword. If you wanted to use it as a class
name, you'd have to write

class [MyClass]
end class

see also:
http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconKeywordsAsControlNamesInCode.asp

http://msdn.microsoft.com/library/en-us/vbcn7/html/vbconElementNames.asp

-- 
Armin
How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


Relevant Pages