<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">Am 25.10.2017 14:12 schrieb "Giuliano Colla via Lazarus" <<a href="mailto:lazarus@lists.lazarus-ide.org">lazarus@lists.lazarus-ide.org</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><div class="quoted-text">
<div class="m_-1493886348489256593moz-cite-prefix">Il 25/10/2017 13:41, Mattias Gaertner
via Lazarus ha scritto:<br>
</div>
<blockquote type="cite">
<pre>No. The Delphi syntax is "ProcIdentifier:=Proc" or
"ProcIdentifier:=@Proc".
The "@Some:=" means assign something to address of Some. Which is bogus.
I guess Delphi's auto dereference actually translates this to
@Some^:=. Still bogus, but valid bogus.
</pre>
</blockquote>
</div><p>From embarcadero doc wiki
(<a class="m_-1493886348489256593moz-txt-link-freetext" href="http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Procedural_Types_(Delphi))" target="_blank">http://docwiki.embarcadero.<wbr>com/RADStudio/Tokyo/en/<wbr>Procedural_Types_(Delphi))</a>:</p>
<p>
</p><blockquote type="cite">
<h2><span class="m_-1493886348489256593mw-headline" id="m_-1493886348489256593Procedural_Types_in_Statements_and_Expressions">Procedural
Types in Statements and Expressions</span></h2>
<p>When a procedural variable is on the left side of an
assignment statement, the compiler expects a procedural value
on the right. The assignment makes the variable on the left a
pointer to the function or procedure indicated on the right.
In other contexts, however, using a procedural variable
results in a call to the referenced procedure or function. You
can even use a procedural variable to pass parameters:
</p>
</blockquote>
[snip]<br>
<p></p>
<p>
</p><blockquote type="cite">
<p>The <b>@</b> operator can also be used to assign an untyped
pointer value to a procedural variable. For example:
</p>
<div dir="ltr" class="m_-1493886348489256593mw-geshi m_-1493886348489256593mw-code m_-1493886348489256593mw-content-ltr">
<div class="m_-1493886348489256593delphi m_-1493886348489256593source-delphi">
<pre class="m_-1493886348489256593de1"> <span class="m_-1493886348489256593kw1">var</span> StrComp<span class="m_-1493886348489256593sy1">:</span> <span class="m_-1493886348489256593kw1">function</span><span class="m_-1493886348489256593br0">(</span>Str1<span class="m_-1493886348489256593sy1">,</span> Str2<span class="m_-1493886348489256593sy1">:</span> <span class="m_-1493886348489256593kw4">PChar</span><span class="m_-1493886348489256593br0">)</span><span class="m_-1493886348489256593sy1">:</span> <span class="m_-1493886348489256593kw4">Integer</span><span class="m_-1493886348489256593sy1">;</span>
<span class="m_-1493886348489256593sy1">...</span>
<span class="m_-1493886348489256593sy2">@</span>StrComp <span class="m_-1493886348489256593sy1">:</span><span class="m_-1493886348489256593sy3">=</span> GetProcAddress<span class="m_-1493886348489256593br0">(</span>KernelHandle<span class="m_-1493886348489256593sy1">,</span> <span class="m_-1493886348489256593st0">'lstrcmpi'</span><span class="m_-1493886348489256593br0">)</span><span class="m_-1493886348489256593sy1">;</span></pre>
</div>
</div>
</blockquote>
<br>
<p></p>
<p>This is no more true (as least as of X10 where I tested and it
gave rise to a compiler error), but it has been for a long time.
That's why I assumed that assigning an untyped pointer to a
procedural variable was both legal and also properly supported.</p></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Did you test with a procedure pointer type or a method pointer type? Cause this might be the important difference here as the example uses a procedure pointer type. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"></div></div>