On Fri, 19 Apr 2002, Prof Abimbola Olowofoyeku wrote:
Then the elements of the array should know their type, that is, even after GetMem there should be a way to call the virtual method.
The elements of the array know their type and you can call the virtual method - as long as you allocate memory for the object with "New".
.....
It still works with GPC. The problem here is using "Getmem" instead of "New". This might be an unnecessary restriction in GPC (i.e., having to use "New") - but it may well be documented (I don't remember - but I know that I don't use "Getmem" for object pointers, and perhaps there was a reason).
That is obviuos, but my question was related to a change of the GPC behaviour (some previous versions I have at hand i.e. 20010121 were able to compile it properly). I actually asked this question some time ago, but then it was about string schemata. Now, I noticed the same with objects and that caused my question. Therefore, I suppose that now, a constructor called as a static method (without new) doesn't (re)create VMTP at all ?
type pt = ^t; t=object .... ... type ar=array[0..10000] of pt; var p : ar;
That's not actually the same - the point was to allocate only the needed space with GetMem - not even the array of pointers with maximal possible size...
Regards, Adam Naumowicz
-------------------------------------- WWW: http://math.uwb.edu.pl/~adamn/ --------------------------------------