<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body smarttemplateinserted="true">
<div id="smartTemplate4-template">Hi,<br>
<br>
why is sizeof on object/class fields sometimes allowed and
sometimes not?<br>
<br>
type TTest = object<br>
f: integer;<br>
class procedure test;<br>
end;<br>
<br>
class procedure TTest.test;<br>
begin<br>
writeln(sizeof(f)); // does not compile<br>
writeln(sizeof(TTest.f)); // compiles<br>
end;<br>
<br>
---<br>
<br>
type TTest = class<br>
f: integer;<br>
class procedure test;<br>
end;<br>
<br>
class procedure TTest.test;<br>
begin<br>
writeln(sizeof(f)); // does not compile<br>
writeln(sizeof(TTest.f)); // does not compile<br>
end;<br>
<br>
surely that should all be equal to sizeof(integer)<br>
<br>
Bye,<br>
<p>Benito </p>
</div>
<br>
</body>
</html>