Forum > Other OS

Brand new iMac i5 27" retina OS10.10.6 cannot create array

<< < (2/5) > >>

summerleas:
The former won't work, the latter might.

As a first step I was hoping that someone might know how Macs access RAM.

I am assuming that the problem is not in free Pascal, but maybe it is ...

summerleas:
On another forum I was directed to:

https://developer.apple.com/library/content/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html

It states that "OS X provides approximately 18 exabytes of addressable space for 64-bit processes."

In which case, my program should compile and run because it requires only about 4 or 5 GB. So the problem is with free Pascal or the way I am using it.

Any suggestions?

summerleas:
In the Free Pascal Reference guide (page 24)

"With the exception of int64, qword and Real types, all base types are ordinal types."

And on page 39 an array is defined as: array[ordinal type, ...]

So can the index of an array be of type int64?

Thaddy:
Most likely the problem is NOT the Mac.
Can you give us a compilable example to reproduce the error.I dusted off my mac recently, so I can debug things again.

The problem is that if you yourself don't provide a compilable example, we start to "assume" the probably correct things and then it suddenly works.
Better have you give a small example that can be compiled.

BTW: I suspect a documentation bug: With the exception of int64, qword and real types"
By now int64 and qword are native ordinal types on most platforms, afaik.
And even real is an alias for double, which has never been an ordinal type anyway.

Anyway some proof:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program untitled;var   a:int64 = 0;  b:qword = 0;  c:real := 0.0;begin  inc(a);  inc(b);  a := pred(a);  b := pred(b);end.
I filed a bug report against the documentation. Mantis #0031280

Don't let this distract you: we will still need a compilable example that replicates your issue.

mischi:
Whether int64 and qword are taken as ordinal seems to depend on 32 bit / 64 bit.
The following test program compiles ok with 64 bit but gives the error message below with 32 bit.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program int4Test;var index: int64;begin  for index := 1 to 10 do    writeln (index)end.
Excerpt of the error message on 32 bit (Darwin for i386):
...
Compiling int4Test.pas
int4Test.pas(4,7) Error: Ordinal expression expected

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version