[fpc-devel] Some thoughts on multi-line string support, and a possible syntax that I think is perfectly clean and Pascal-ish.

Sven Barth pascaldragon at googlemail.com
Fri Jul 5 22:17:28 CEST 2019


Am 05.07.2019 um 19:38 schrieb Ryan Joseph:
>
>> On Jul 5, 2019, at 1:34 PM, Sven Barth via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
>>
>> Why should they always be required? If your multiline string is shorter than 256 characters then all is well.
>>
>> And otherwise you'd have the same problem with an ordinary string constant.
>>
>> So this behaves exactly as expected and desired.
>>
> Sure, but I suspect majority of strings will be longer than 255. I guess this isn’t just multi-line string related but how do I declare a string constant that doesn’t then change “string” in the entire unit? I tried the typed constant but that doesn’t seem to work (got Illegal expression).

I didn't get an Illegal Expression error (maybe that's still a problem 
of the multi line string support? I tested with a normal string), but 
the compiler nevertheless concatenates the string.

So in essence: if you want long string constants use $H+ mode.

Regards,
Sven


More information about the fpc-devel mailing list