ThN
ThN

Reputation: 3276

Is there a replacement for variant data type in .NET?

I would like to know if there is a variant data type in Delphi prism.

I am converting a Delphi win32 application for Delphi Prism .NET environment.

Upvotes: 0

Views: 9118

Answers (2)

noisecapella
noisecapella

Reputation: 814

I think variant data types in C++/COM are roughly equivalent to the object type in C#. The Wikipedia article confirms this: http://en.wikipedia.org/wiki/Variant_type in the fourth paragraph

Upvotes: 1

Oded
Oded

Reputation: 499172

The closest thing is Object as all types derive from it. This is not a great solution though.

With .NET 4.0 the dynamic keyword was introduced that may be closer to what you are looking for.

A direct analogue does not exist.

Upvotes: 5

Related Questions