On Fri, Jul 5, 2019 at 1:14 PM Ryan Joseph <[email protected]> wrote:
> This may present a bit of problem then because you don't appear to be able
> to opt-in to long strings just for constants. $h+ will always be required
> for multi-line strings but I don’t want the rest of my “string” types to
> turn into ansistrings. Is there any solution to this?
>
I don't think it's really true that you'll *always* need long strings for
multi-line stuff, however, if you're concerned about this in general there
is in fact a way to switch between {$H+} and {$H-}:
program Example;
{$push}
{$H+}
var Ansi: String;
{$pop}
var Short: String;
begin
WriteLn(GetTypeKind(Ansi));
WriteLn(GetTypeKind(Short));
end.
which prints:
tkAString
tkSString
indicating they're the types you'd want / expect.
_______________________________________________
fpc-devel maillist - [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel