<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 5, 2019 at 8:14 PM Ben Grasset <<a href="mailto:operator97@gmail.com">operator97@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Fri, Jul 5, 2019 at 8:08 PM Ryan Joseph <<a href="mailto:genericptr@gmail.com" target="_blank">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">
ah! Your code works but mine doesn’t! maybe the line ending are messing it up? I get "String constant too long while ansistrings are disabled”.\<br></blockquote><div><br></div><div>No, that makes no sense whatsoever. </div><div><br></div><div>Another example:</div><div><br></div><div>{$mode objfpc}<br>{ explicitly set H- ! }<br>{$H-}<br>{ using CRLF while my file is actually LF, just for fun }<br>{$MULTILINESTRINGLINEENDING CRLF}<br><br>program test;<br><br>var 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><br>begin <br> WriteLn(lines); <br>end.<br></div><div><br></div><div>I'm not even sure which code (that is actually a complete program with a begin and end) you're talking about.</div></div></div></blockquote><div><br></div><div>I just noticed, in fact: the compiler actually completely ignores {$H+} and {$H-} for "typed" string constants *and* variables, in all cases. Even with {$H-}, and with not "ansistring", but "string", my above example still works (i.e. the compiler implicitly "uptypes" it to an ansistring if it needs to, basically). Only for "true constant" strings does it care about {$H+} and {$H-} at all.</div><div><br></div><div>I'm unsure whether or not this is intentional behaviour.</div></div></div>