[Lazarus] strcat problem

Koenraad Lelong lazarus2 at de-brouwerij.be
Sun Jun 26 11:22:22 CEST 2016


Op 25-06-16 om 14:39 schreef Howard Page-Clark:
> On 25/06/16 12:38, Koenraad Lelong wrote:
>> Op 25-06-16 om 00:59 schreef David W Noon:
>>>
>>>    const
>>>       TEXT : ansistring =
>>>          #10'Now is the winter of our discontent'#10
>>>          'Made glorious summer by this sun of York;'#10
>>  Fatal: Syntax error, ";" expected but "const string" found
>>>          'And all the clouds that lour''d upon our house'#10
>> ...
>>
>> Does not compile. Or do I need some compiler-switch ?
>
> No, you need concatenation operators inserted:
>
> const
>       TEXT : ansistring =
>          #10'Now is the winter of our discontent'#10
>          +'Made glorious summer by this sun of York;'#10
>          +'And all the clouds that lour''d upon our house'#10
>          +'In the deep bosom of the ocean buried.'#10
>          + etc...
>

Soo simple, why didn't I think of that.

I finally have this :
  cTekst : PChar =
         #10'Now is the winter of our discontent'#10
         +'Made glorious summer by this sun of York;'#10
         +'And all the clouds that lour''d upon our house'#10
         +'In the deep bosom of the ocean buried.'#10
         +'Now are our brows bound with victorious wreaths;'#10
         +'Our bruised arms hung up for monuments;'#10
         +'Our stern alarums changed to merry meetings,'#10
         +'Our dreadful marches to delightful measures.'#10
         +'Grim-visaged war hath smooth''d his wrinkled front;'#10
         +'And now, instead of mounting barded steeds'#10
         +'To fright the souls of fearful adversaries,'#10
         +'He capers nimbly in a lady''s chamber'#10
         +'To the lascivious pleasing of a lute.'#10;

Works fine on OpenSuse and Raspberry Pi.

Thanks all.


Koenraad.



More information about the Lazarus mailing list