On Fri, Jul 5, 2019 at 11:35 AM Ben Grasset <operato...@gmail.com> wrote:
> On Fri, Jul 5, 2019 at 11:29 AM Ryan Joseph <generic...@gmail.com> wrote: > >> This may not be related but why does "l: string = lines;” work, shouldn’t >> that be an error or at least get clipped? I’m seeing writeln prints out the >> entire string as if it was an ansistring. >> > > Your example has nothing to do with multi-line strings specifically, and > is completely normal, expected behavior when in {$H+}. > > You could write the exact same constant string with single-line strings > using the "addition operators and sLineBreak" method, and assign it to the > variable the exact same way, and it would display identically. > Also, note that in all cases "untyped" constant strings behave exactly like ShortStrings or AnsiStrings, depending on whether {$H+} is being used, in every way (meaning, they can be passed *directly* to WriteLn with no intermediate variable required.) The only significant difference is that they are immutable, embedded-in-the-executable "true" constants.
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel