[fpc-devel] Some thoughts on multi-line string support, and a possible syntax that I think is perfectly clean and Pascal-ish.
Ryan Joseph
genericptr at gmail.com
Fri Jul 5 19:14:41 CEST 2019
> On Jul 5, 2019, at 12:10 PM, Ben Grasset <operator97 at gmail.com> wrote:
>
> Explicit "ShortString" variables are still exactly what they say they are in all cases though, of course.
>
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?
// ERROR: String constant too long while ansistrings are disabled
{$h+}
const lines = `
#version 150
uniform sampler2D textures[8];
in vec2 vertexTexCoord;
in vec4 vertexColor;
in float vertexUVMap;
out vec4 fragColor;
void main()
{
if (vertexUVMap == 255) {
fragColor = vertexColor;
} else {
fragColor = texture(textures[int(vertexUVMap)], vertexTexCoord.st);
if (vertexColor.a < fragColor.a) {
fragColor.a = vertexColor.a;
}
}
}`;
{$h-}
Regards,
Ryan Joseph
More information about the fpc-devel
mailing list