Try:
{$mode objfpc}
var
x:integer;
MyArray:array[1..10]of integer = (88,82,89,80,29,20,28,21,22,20);
begin
for x in myarray do
begin
MyArray[x] := x*x;
writeln('Square of array elements is: ',MyArray[x]);
end;
for x in myarray do
writeln('Square is: ',MyArray[x]);
readln;
end.
The reason is that x has double meaning in your code.
In my example x has single meaning, the value, not the value AND the index! It is also "Modern Pascal".
(The modern pascal guide you refer to has only one really big flaw: a complete misunderstanding of interfaces and the differences between COM and CORBA, ignore that chapter, it is a known shortcoming, there are better guides, many)