const
data : array[ 1..{leave open} ] of byte = ( 11 , 12 , 13 );
datalen = sizeof( data ) div data[ 1 ];
Would this possible in a way?
In C it is possible.
Now I have to know the length of the array data and say it before.
___
fpc-pascal maillist
With Delphi/FPC you have a few choices:
Fixed length arrays, dynamic length arrays, and variant type arrays
Fixed length arrays cannot be resized and their lower and upper bounds are
immutable. The lower and upper bounds can start at any ordinal position. The
upper bound can ever be less than
Hello Anthony,
all I want is that the compiler calculates the len of the const array.
const
data : array[ ... ] of byte = ( 11 , 12 , 13 );
datalen = sizeof( data ) div data[ 0 ];
In C it is possible.
I think in FPC not :-(
Best regards, Rainer
Am Thursday 31 December 2009 14:54:37
No, the compiler will not fill in the array length based on your element
list. It does compute the length while compiling and *you* need to match it
in your declaration.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
Am Thursday 31 December 2009 15:33:50 schrieb Anthony Walter:
No, the compiler will not fill in the array length based on your element
list. It does compute the length while compiling and *you* need to match it
in your declaration.
But it would be a step to more userfriendly if the compiler
Sure, I agree.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Hello All,
Sorry for the offtopic, but I wish you all happy new year.
I hope that in 2010 we'll see Pascal, FPC and Lazarus become more main
stream.
Have a great new year and 2010,
Ido
http://ik.homelinux.org/
___
fpc-pascal maillist -
I join Ido in wishing you all a very happy new year.
To Ido, shana tova umetukah.
Giuliano
ik ha scritto:
Hello All,
Sorry for the offtopic, but I wish you all happy new year.
I hope that in 2010 we'll see Pascal, FPC and Lazarus become more main
stream.
Have a great new year and
Hello friends,
Happy 2010 to every FPC-Pascal user!
--
Silvio Clecio
--
Blog estilo mural - http://silvioclecio.blogspot.com
Twitter - http://twitter.com/silvioprog
--
programmer ObjectPascal - http://silvioprog.blogspot.com
--
O homem está sempre disposto a negar tudo aquilo que não