<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">El 27/01/18 a las 15:10, C Western
escribió:<br>
</div>
<blockquote type="cite"
cite="mid:6063b203-8c58-33f6-a8d6-5bf4b6e75aaf@c-m-w.me.uk">The
following innocuous looking code generates a range check error:
<br>
<br>
{$R+}
<br>
function Count: qword;
<br>
begin
<br>
Result := 0;
<br>
end;
<br>
var
<br>
i: Integer;
<br>
begin
<br>
for i := 0 to Count-1 do
<br>
WriteLn(i);
<br>
end.
<br>
<br>
I can (more or less) see why, but it means that I can't (for
example) compile the Cocoa widget set in 64 bit with bounds
checking on, as then qword seems to be used as a count for, for
example, NSarray.
<br>
<br>
Am I missing something?
<br>
</blockquote>
<br>
The problem is that count is qword, so the operation is qword until
it needs to convert it<br>
<br>
for i:=0 to integer(qword( qword(count) - qword(1)) do<br>
<br>
try this:<br>
<br>
for i := 0 to <b>integer</b>(Count)-1 do
<br>
<br>
<pre class="moz-signature" cols="72">--
--------
Saludos
Santiago A.</pre>
</body>
</html>