<HTML>
<style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</style>Sorry for not quite understanding what you mean. Are you meaning that if I detect something like this in the main file...<br>
<br>
****<br>
program SomeProg;<br>
<br>
function PureFunc(A: Integer): Integer; forward;<br>
<br>
procedure TestFunc;<br>
<div>begin</div><div> { Call PureFunc }<br>
</div><div>end;<br>
<br>
function PureFunc(A: Integer): Integer; pure;<br>
begin<br>
{ etc. }<br>
end;<br>
****<br>
<br>
... an error should be thrown? But if something like this appears:<br>
<br>
****<br>
unit SomeUnit;<br>
<br>
interface<br>
<br>
function PureFunc(A: Integer): Integer;<br>
<br>
implementation<br>
</div><br>
procedure TestFunc;<br>
<div>begin</div><div> { Call PureFunc }<br>
</div>end;<br>
<br>
function PureFunc(A: Integer): Integer; pure;<br>
begin<br>
{ etc. }<br>
end;<br>
****<br>
<br>
... all is well? Is it only problematic if a function is defined as "forward" and not "pure" on the same line?<br>
<br>
Gareth aka. Kit<br>
<br>
<span style="font-weight: bold;">On Fri 10/08/18 19:51 , "Sven Barth" pascaldragon@googlemail.com sent:<br>
</span><blockquote style="BORDER-LEFT: #F5F5F5 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT:0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"><div dir="auto"><div><div class="gmail_quote"><div dir="ltr">J. Gareth Moreton <<a href="javascript:top.opencompose('gareth@moreton-family.com','','','')">gareth@moreton-family.com</a>> schrieb am Fr., 10. Aug. 2018, 18:44:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Thanks Sven,</div><div><br>
</div><div>Sorry if I'm bringing up obvious points. I've set "pure" to be interface-only - it's a little tricky because if you now specify it in the main source file, it says that it can't be used in the implementation section, even though, really, the main file doesn't have such section. Still, that can be dealt with.</div></blockquote></div></div><div dir="auto"><br>
</div><div dir="auto">You shouldn't declare it as interface only, but you should disallow the situation that it is not set for the forward def in the interface, but for the one in the implementation section. Other combinations are valid. </div>
<div dir="auto">I think the function to look for is add_proc_definition (can't check currently). </div><div dir="auto">Also the defs should contain methods to check whether they had been declared in the interface or implementation section so you can use those. </div><div dir="auto"><br>
</div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>
</blockquote></HTML>