Forum > General

Multi Class ancestors

(1/4) > >>

captian jaster:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---TMain = Class(TForm,TFileSearcher)  It says that it expects an interface but gets TFileSearcher...
I can't have more then one ancestor?  %)


--- Quote ---I can't have more then one ancestor?
--- End quote ---
No, you can't with classes. Multiple inheritance in Object Pascal is achieved through the use of interfaces (like Java and other modern OOP languages).

If you feel lucky... try C++ out, it allows multiple inheritance through classes.

:o) Benny

Talking of c++ does anyone know of a good reason for case sensitivity?

mas steindorff:

--- Quote from: zariq on December 20, 2010, 06:49:45 pm ---Talking of c++ does anyone know of a good reason for case sensitivity?

--- End quote ---
At one time, there was a limit on how long a variable name could be.  case allowed CONSTANTS, Globles, and locals to coexist (not a good practice as far as Gobles and locals IMHO).  libraries were just include files that were just code and still are for embedded systems so your variable naming would have become even more restrictive.

PS, Now days, there is usually a switch you can set to ignore the case but it may mess up older libary code if you use it.


[0] Message Index

[#] Next page

Go to full version