What does [String] mean?

R

Rob Richardson

Greetings!

The help page for the DictionaryBase class includes a class with the
following property:

Default Public Property Item(key As [String]) As [String]
Get
Return CType(Dictionary(key), [String])
End Get
Set
Dictionary(key) = value
End Set
End Property

I have never before seen a type surrounded by brackets. What does it mean?

Thanks very much!

Rob
 
C

CJ Taylor

In this instance, it means absolutly nothing. AFAIK, its only used when you
want to use a keyword/class name as avariable..

i.e

Dim [Assembly] as Assembly

Maybe I have that wrong, but thats all I've ever seen it for.

-cJ
 
R

Robin Tucker

Yup, seems right to me. Only ever used it to hide keyword in variable name.

CJ Taylor said:
In this instance, it means absolutly nothing. AFAIK, its only used when you
want to use a keyword/class name as avariable..

i.e

Dim [Assembly] as Assembly

Maybe I have that wrong, but thats all I've ever seen it for.

-cJ
Rob Richardson said:
Greetings!

The help page for the DictionaryBase class includes a class with the
following property:

Default Public Property Item(key As [String]) As [String]
Get
Return CType(Dictionary(key), [String])
End Get
Set
Dictionary(key) = value
End Set
End Property

I have never before seen a type surrounded by brackets. What does it mean?

Thanks very much!

Rob
 
H

Herfried K. Wagner [MVP]

* "Rob Richardson said:
The help page for the DictionaryBase class includes a class with the
following property:

Default Public Property Item(key As [String]) As [String]
Get
Return CType(Dictionary(key), [String])
End Get
Set
Dictionary(key) = value
End Set
End Property

I have never before seen a type surrounded by brackets. What does it mean?

It doesn't make sense in the sample above. Documentation:

<URL:http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec2_2.asp>
 

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