[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
Sat Jul 6 15:10:31 CEST 2019



> On Jul 6, 2019, at 8:07 AM, Ben Grasset <operator97 at gmail.com> wrote:
> 
> Everything he was talking about was clearly based on fundamentally not understanding the basic differences between things like "const SomeString: String = " and "var SomeString: AnsiString = ", and assuming that they were somehow *supposed* to be affected the same way by {$H+}, and so on.
> 
> Sorry for getting a bit frustrated everyone, but it's annoying to have this long back and forth discussion about a vague "problem" that simply does not exist.
> 

I got it now, using typed constants is the solution. I got confused with $H+ stuff and probably just wasn’t paying enough attention. 

Btw, here is the "Illegal expression” error which I mentioned before but lost track of.

==========

{$mode objfpc}

program test;

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;
      }
    }

    // TODO: testing
    fragColor = vec4(1,0,0,1);
  }
`;

var
  s: ansistring = lines;
begin
  writeln(lines);
end.

Regards,
	Ryan Joseph



More information about the fpc-devel mailing list