Is there a replacement for variant data type in .NET?
-
16-06-2021 - |
سؤال
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.
المحلول
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.
نصائح أخرى
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
لا تنتمي إلى StackOverflow