What are square brackets used for?

Hello all, just curious on this.
What's the difference between something like
Dim strName as String, and
Dim strName as [String] ?
And where/why would you use [ ] if there is a difference?
Thank you in advance.
[237 byte] By [MickyG] at [2008-1-27]
# 1
It is to create variable which is already used like stop...



public enum playstate
play
pause
[stop]
next
end enum

elf_sander at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
elf_sander wrote:
It is to create variable which is already used like stop...



public enum playstate
play
pause
[stop]
next
end enum

I don't get it, sorry, but I too don't know about this [] thing. And Google is useless.

Blisardo at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
They are used for reserved words. Stop is a reserved word. If you were to do the following:

Public Sub Stop()
_Stopped = True
End Sub

You would get a compile error. Adding brackets around Stop allows you to use it. In vb.classic this wasn't available.
Cheers,
Chid

chid at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
Ok I understand that, it makes sense but I don't see why you'd use it in this context then:
Dim strName as String
strName = [String].Empty
I've seen it used like that in the ASP.NET starter kits. Any ideas why it's not this instead:
strName = String.Empty
Thanks for your help Smile
MickyG at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 5
There is no difference. I have found that some of the C# to VB converters will put brackets in where they don't really belong. I recently converted a project and it changed all references to the Text property of the object to [Text]. Doesn't hurt anything, just a bit of overkill. That might explain the code in the starter kits.
Chid
chid at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...