I was testing the below code from the fpc documentation and I get the "Can't take the address of constant expressions" error, with the cursor positioned just after "(S)" in the 2nd WriteLn statement.<br>
<br>I do not understand how to fix this.  I did search for the error, but it none of it makes sense.<br>I'll solve my issue another way, but I'm wondering if this example should be fixed.<br><br>0.9.31-30142, 2.4.2, win32-Vista<br>
<br>Any suggestions?<br><br><br>source: <a href="http://www.freepascal.org/docs-html/rtl/sysutils/ansiextractquotedstr.html">http://www.freepascal.org/docs-html/rtl/sysutils/ansiextractquotedstr.html</a><br><br><span style="font-family: courier new,monospace;">Program Example51;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">{ This program demonstrates the AnsiQuotedStr function }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Uses sysutils;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Var S : AnsiString;</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Begin</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  S:='He said "Hello" and walked on';</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  S:=AnsiQuotedStr(Pchar(S),'"');</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  Writeln (S);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Writeln(AnsiExtractQuotedStr(Pchar(S),'"'));</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">End.</span><br><br><br><br><br>