Am 02.07.2019 um 19:43 schrieb Michael Van Canneyt:
On Tue, 2 Jul 2019, Ryan Joseph wrote:
On Jul 2, 2019, at 10:32 AM, Michael Van Canneyt
wrote:
It overwrites the first. There is no such thing as '2 VMT tables'.
That’s what I thought. How costly is this? Not sure what it’s doing
un
Op 2019-07-02 om 19:41 schreef Ryan Joseph:
On Jul 2, 2019, at 10:32 AM, Michael Van Canneyt wrote:
It overwrites the first. There is no such thing as '2 VMT tables'.
That’s what I thought. How costly is this? Not sure what it’s doing under the
hood but I’d like to know more.
You'd expect
On Tue, 2 Jul 2019, Ryan Joseph wrote:
On Jul 2, 2019, at 10:32 AM, Michael Van Canneyt wrote:
It overwrites the first. There is no such thing as '2 VMT tables'.
That’s what I thought. How costly is this? Not sure what it’s doing under the
hood but I’d like to know more.
As far as I
> On Jul 2, 2019, at 10:32 AM, Michael Van Canneyt
> wrote:
>
> It overwrites the first. There is no such thing as '2 VMT tables'.
That’s what I thought. How costly is this? Not sure what it’s doing under the
hood but I’d like to know more.
Regards,
Ryan Joseph
On Tue, 2 Jul 2019, Ryan Joseph wrote:
Another question: what happens if you call the constructor twice? Does this
create 2 VMT tables or overwrites the first?
It overwrites the first. There is no such thing as '2 VMT tables'.
Michael.
___
fpc-pa
Another question: what happens if you call the constructor twice? Does this
create 2 VMT tables or overwrites the first?
type
TA = object
constructor Create;
procedure DoThis; virtual;
end;
procedure TA.DoThis;
begin
writeln('TA.Do
Op 27/06/2019 om 23:56 schreef Ryan Joseph:
On Jun 27, 2019, at 5:53 PM, Ben Grasset wrote:
If you specifically need inheritance (combined with virtual methods) you should
probably just use classes, because doing it with objects will require heap
allocation regardless.
Heap allocate how so?
On Thu, Jun 27, 2019 at 5:57 PM Ryan Joseph wrote:
>
> Heap allocate how so? Calling the constructor seems to fix this and puts
> the VMT table on the stack (I think anyways). Btw I’m doing this
> specifically as testing for a possible “advancedobjects” mode switch and
> the only reason to use ob
> On Jun 27, 2019, at 5:53 PM, Ben Grasset wrote:
>
> If you specifically need inheritance (combined with virtual methods) you
> should probably just use classes, because doing it with objects will require
> heap allocation regardless.
>
Heap allocate how so? Calling the constructor seems
On Thu, Jun 27, 2019 at 4:17 PM Ryan Joseph wrote:
> Why do I get a runtime error with this?
>
If you specifically need inheritance (combined with virtual methods) you
should probably just use classes, because doing it with objects will
require heap allocation regardless.
___
> On Jun 27, 2019, at 4:20 PM, Jonas Maebe wrote:
>
> tt.pp(4,6) Warning: Virtual methods are used without a constructor in "TA"
> tt.pp(14,6) Warning: Virtual methods are used without a constructor in "TB"
That’s what the meant! Thanks
Regards,
Ryan Joseph
__
> On Jun 27, 2019, at 4:42 PM, Stefan V. Pantazi wrote:
>
> Read down the first page, the section "Objects - Dynamic Variables" - all
> will become clear.
>
> By avoiding the virtual methods, you can keep your objects static, all stored
> on stack, no need for constructors. I personally find
Read down the first page, the section "Objects - Dynamic Variables" -
all will become clear.
By avoiding the virtual methods, you can keep your objects static, all
stored on stack, no need for constructors. I personally find very useful
for my projects.
Find fixed example below. Hope it help
On 27/06/2019 22:17, Ryan Joseph wrote:
> Why do I get a runtime error with this?
tt.pp(4,6) Warning: Virtual methods are used without a constructor in "TA"
tt.pp(14,6) Warning: Virtual methods are used without a constructor in "TB"
You have to add a constructor and call it, otherwise the object
14 matches
Mail list logo