<div dir="ltr"><div dir="ltr">On Sat, Jul 6, 2019 at 9:10 AM Ryan Joseph <<a href="mailto:genericptr@gmail.com">genericptr@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Btw, here is the "Illegal expression” error which I mentioned before but lost track of.<br>
<br>
==========<br>
<br>
{$mode objfpc}<br>
<br>
program test;<br>
<br>
const lines: ansistring = `<br>
  #version 150<br>
<br>
  uniform sampler2D textures[8];<br>
  in vec2 vertexTexCoord;<br>
  in vec4 vertexColor;<br>
  in float vertexUVMap;<br>
  out vec4 fragColor;<br>
<br>
  void main()<br>
  {<br>
    if (vertexUVMap == 255) {<br>
      fragColor = vertexColor;<br>
    } else {<br>
      fragColor = texture(textures[int(vertexUVMap)], vertexTexCoord.st);<br>
      if (vertexColor.a < fragColor.a) {<br>
        fragColor.a = vertexColor.a;<br>
      }<br>
    }<br>
<br>
    // TODO: testing<br>
    fragColor = vec4(1,0,0,1);<br>
  }<br>
`;<br>
<br>
var<br>
  s: ansistring = lines;<br>
begin<br>
  writeln(lines);<br>
end.<br>
<br>
Regards,<br>
        Ryan Joseph<br></blockquote><div><br></div><div>That really is an illegal expression (I.E. once again expected behavior) whether multi-line strings are involved or not. The following is equally invalid:</div><div><br></div>{$mode objfpc}<br><br>program test;<br><br>const lines: ansistring = 'just a single line string';<br><br>var<br>  s: ansistring = lines;<br>begin<br>  writeln(lines);<br><div>end.</div><div><br></div><div>You cannot under any circumstances initialize a variable with a "typed" constant, because typed constants are themselves mutable by default.</div></div></div>