These aren't arrays:
[pascal]
tlx :integer;
tly, blx, bly, trx, tryi, brx, bry :integer;
[/pascal]

Yet you try to make arrays out of them by this:
[pascal]
map.tlx[l2,l1] :=l2+a[l2-1,l1];
[/pascal]