type TMyArray = TArray< integer >; //without spaces procedure PrintArray(a: TMyArray); var i:integer begin for i:=0 to Length(a)-1 do write(a, ); Writeln end; a: TMyArray; i: integer; begin SetLength(a, 10); for i:=0 to Length(a)-1 do a:=Random(100); PrintArray(a); a.Sort; PrintArray(a); // add reverse sorting using anonymous block for Sort() here end.