[fpc-pascal] Const Array Length (was Dynamic Array Length)
Rainer Stratmann
RainerStratmann at t-online.de
Sun Jan 3 13:39:50 CET 2010
Am Sunday 03 January 2010 13:19:39 schrieb Jonas Maebe:
> On 03 Jan 2010, at 13:12, Rainer Stratmann wrote:
> > Am Sunday 03 January 2010 13:03:37 schrieb Frank Peelo:
> >> Rainer Stratmann wrote:
> >>> Then you can automatically calculate the amount:
> >>> amax = sizeof( a ) div sizeof( a[ 1 ] );
> >>
> >> If this syntax was in Pascal, would you use
> >> High(a)-Low(a)+1
> >> rather than sizeof()?
> >
> > I think high and low has an other meaning.
>
> You might want to read the manual:
> http://www.freepascal.org/docs-html/ref/refsu14.html
Ok, I read it before.
> > I C this works. There I have the idea from.
>
> Pascal has better ways to deal with array bounds.
But at this moment it is not possible to make a const array with auto
calculated range ( [ 1..] ). It would be easy to implement, I think.
>
> Jonas_______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
More information about the fpc-pascal
mailing list