[fpc-pascal] class abstract

ik idokan at gmail.com
Fri May 6 21:55:03 CEST 2011


On Fri, May 6, 2011 at 22:47, Sven Barth <pascaldragon at googlemail.com>wrote:

> On 06.05.2011 21:21, ik wrote:
>
>> Hello,
>>
>> I have two questions regarding class Abstract:
>>
>> 1. From what version of FPC does it support ?
>>
>
> At least 2.4.2 supports it. It might be 2.4.0 as well (I don't know that
> for sure though).
>
>
>  2. Can I inherit from a class and the new class that I declare can be
>> set as abstract ?
>>
>> I mean
>>
>> TClassA = class abstract
>> ...
>> end;
>>
>> TClassB = Class(TClassA) abstract ?
>>
>> If so, then what am I missing here? FPC (2.5.1) tell me that it is
>> expecting ":", but "abstract" was found.
>>
>
> The "abstract" needs to be put after the "class" and before the parent
> class (it's strange, but the way Borland has decided things are done...):
>

Thanks, that works :)


>
> TClassB = class abstract(TClassA)
>
> Regards,
> Sven
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110506/b929326b/attachment.html>


More information about the fpc-pascal mailing list