as Setharian said, this is strictly not the correct use of OO. The above code would work better as ...Originally Posted by noeska
[pascal]var
mesh1:=TModel;
begin
mesh1:=TMsaModel.Create(nil);
mesh1.LoadFromFile('models\hog2.txt');
end;[/pascal]
if you plan to use it that way.
I disagree with Setharian on the suggestion of using enumerated types though. I think a better way and more OO way of achieving that, would be through the use of class factories. If you would like me to explain that idea further or provide a small example, let me know.
Bookmarks