I have types in distincts units with the same name and I have the unit name in a string. I need to access the specific type of this unit. How do I do that?
Example:
unit Unit1
type
TFooType = (
bar1,
bar2
);
then, I have another unit
unit Unit2
type
TFooType = (
foo1,
foo2,
foo3
);
And, somewhere in my code I have the a string variable "UnitName" with the value 'Unit1' within it and I want to access the Unit1's "TFooType" type by the variable.
I'm using Delphi 2007
Sorry for my bad english.
Thanks in advance.