On Fri, 28 Mar 2008, Jonas Maebe wrote:
> > On 28 Mar 2008, at 07:47, Martin Schreiber wrote: > > >What is wrong with this code: > >" > >program rangeerror; > >{$ifdef FPC}{$mode objfpc}{$h+}{$endif} > >{$ifdef mswindows}{$apptype console}{$endif} > >uses > >{$ifdef FPC}{$ifdef linux}cthreads,{$endif}{$endif} > >sysutils; > >type > >colorty = type longword; > >const > >cl_mapped = colorty($90000000); > >type > >ttestclass = class > > private > > fcolor: colorty; > > published > > property color: colorty read fcolor write fcolor default cl_mapped; //<<-- > >end; > >begin > >end. > > It compiles again. Unrelated (because I think such declarations are broken for > fpu types/values): what code do you have to write so that this default value > is actually used? It is used in streaming in the classes unit; the streaming mechanism checks the actual value against this value: if it is the same, the value is not streamed. Martin by himself probably doesn't have specific code. Michael. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel