[fpc-devel]Re: array of char

Jonas Maebe jonas at zeus.rug.ac.be
Fri Sep 29 09:18:23 CEST 2000


>> const
>>  CharsDes1:array[0..383]of char=
>>   '0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF'+
>>  (snipped 4 identical lines...)
>>   '0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF';
>>
[cut]
>The problem is that, when you Assign something to a var-constant
>(initialized variable array),
>the expression (your long string) will get processed first, before passing
>along to the const/var.
>Thus, the shortstring Concatenation operation truncated your string before
>it is passed to the const.

This is correct.

>It is perfectly fine with your data structure. The problem is the way that
>it is assigned.
>(In other words, you cannot initialize that array directly)

Yes you can, but it's a lot more typing work:

 const
  CharsDes1:array[0..383]of char=
   ('0','1','2','3','4',...)


Jonas




More information about the fpc-devel mailing list