Loren Kuich
Loren Kuich

Reputation: 603

Of Type VB6 Equivalent

In VB.NET, I could declare a function like this:

    Function Generic(Of T)(ByVal arg As String) As T
        ...
    End Function

From an MSDN article: http://msdn.microsoft.com/en-us/library/ms172193.aspx

Unfortunately, I can't directly C+P this function into a VB6 project.

Does VB6 not support the 'Of' keyword? There is not much documentation on it.

Is there a VB6 equivalent for this VB.NET sample?

Upvotes: 2

Views: 229

Answers (1)

competent_tech
competent_tech

Reputation: 44931

No, there is not a VB6 equivalent because Vb6 does not support generics. In fact, generics didn't even arrive in .Net until version 2.0.

You need to explicitly declare the data type for T in VB6 (i.e. write a standard, non-generic function).

Upvotes: 3

Related Questions