[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:38:47 CEST 2019



> 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).

const lines: AnsiString = `
  #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;
      }
    }
  }`;


Regards,
	Ryan Joseph



More information about the fpc-devel mailing list