Re: [fpc-pascal] Virtual Constants

2013-03-03 Thread Adrian Veith
Am 01.03.2013 21:31, schrieb Daniel Gaspary: The idea is strange. But here it is: Is possible to have a Class constant with different values in class descendants ? Would be something like that: TA = class const c1: integer; virtual; class function GetC1: integer; //returns c

Re: [fpc-pascal] Virtual Constants

2013-03-03 Thread Daniel Gaspary
On Sun, Mar 3, 2013 at 11:13 AM, Joao Morais wrote: > Afaik no, but you can override class virtual methods which might give > you the correct value: Exactly what I was trying to avoid. :) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:

Re: [fpc-pascal] Virtual Constants

2013-03-03 Thread Joao Morais
On Fri, Mar 1, 2013 at 5:31 PM, Daniel Gaspary wrote: > > Is possible to have a Class constant with different values in class > descendants ? Afaik no, but you can override class virtual methods which might give you the correct value: TA = class protected class function value: integer; v

Re: [fpc-pascal] Virtual Constants

2013-03-01 Thread Michael Van Canneyt
On Fri, 1 Mar 2013, Daniel Gaspary wrote: The idea is strange. But here it is: Is possible to have a Class constant with different values in class descendants ? Would be something like that: TA = class const c1: integer; virtual; class function GetC1: integer; //returns c1 en

[fpc-pascal] Virtual Constants

2013-03-01 Thread Daniel Gaspary
The idea is strange. But here it is: Is possible to have a Class constant with different values in class descendants ? Would be something like that: TA = class const c1: integer; virtual; class function GetC1: integer; //returns c1 end; TB = class(TA) const c1: integer