If TOneD is an array[0..9] of integer, I would expect TTwoD to be an array[0..9,0..9] of integer?
Code: [Select]type
ToneD=array[0..9] of integer;
TtwoD=Class(Tobject)
private
grid: array[0..9] of OneD;
...
function getmiddlecell:integer;
begin
result:=grid[4][4] //does not work. what should it be?
end;
getMiddleCell() is an ordinary function, not a method associated with the class. As a result it has limited access to the grid 2D array since it's marked private. There are three possible solutions: make the function part of the class (assuming it's in the same unit, otherwise you'll be messing with helpers), move grid into the public part, or access it via a property.
The syntax for 2D properties temporarily eludes me. Also I don't know whether it can be generalised for more than two indices.
MarkMLl