Hi there,
The error is caused by Pascal running under DOS.
DOS uses old memory conventions, in as much as you have limited resources, in only 64k addressable memory blocks/ 16k chunks. When you define large arrays or too many variables that go over the Stack/Heap space limits, you will be unable to compile code and will get the error you describe.
The answer is to do one of the following:
1. reduce the amount of variables.
2. adjust the heap/stack space using the {$M stack,heap} or {$MEM xyz} compiler directives.
3. adjust where variables are stored (see "absolute")
4. Use a different (32bit) compiler.
I found the following code works just fine:
---- listing ----
program Test;
uses crt;
type
TColor = Array[1..160,1..120] of byte;
var
Colors: TColor;
x,y: byte;
begin
for y:=Low(Colors) to High(Colors) do
for x:=Low(Colors[y]) to High(Colors[y]) do
Colors[x,y]:=0;
end.
I hope this helps, but feel free to mail me (mystic.smeg@yahoo.co.uk) should you need further help.
na