<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 04/01/2012 20:01, Pete Cervasio wrote:
<blockquote cite="mid:201201041401.51933.cervasio@airmail.net"
type="cite">
<meta name="qrichtext" content="1">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">On Wednesday, January 04, 2012 01:26:52 pm
Martin wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;"> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> TForm1 = class(TForm)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> public</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> FFoo: TFoo;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> property Num: Integer read FFoo.FBar;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> end;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">Just a 'for your info' note: Kylix doesn't
allow the above. Nor does it allow accessing the property
FFoo.Bar as a parameter to the read. This makes sense to me,
though, because FFoo may very well be nil when code tries to
read Form1.Num.</p>
<br>
</blockquote>
<br>
Well the property is rejected by fpc too. But then a property is
always treated as if it was a function (or procedure for the
setter). So that is more than referring to a field.<br>
<br>
To be honest I discovered this by accident, it was meant to use a
field from a record...<br>
<br>
the nil situation is not a concern here, a programmer can always
write code that can fail on nil pointers. FFoo could well have the
same live time as the Form... <br>
</body>
</html>