function najmiasto(dane:typ):typ;stdcall;
var
wynik2:typ;
Tab:array[0..49] of integer;
npo,nwa,nwr,nsz,nkr,a,i,j:integer;
po,wa,wr,sz,kr,max:extended;
begin
writeln('XXXXXXXXXXXXXXXXXXXXXXX');
SetLength(wynik2,1);
SetLength(wynik2[0],4);
for i:=0 to high(dane) do
Tab[i]:=StrToInt(dane[i][5])*StrToInt(dane[i][6])-strtoint(dane[i][7]);
for i:=0 to high(Tab) do
begin
for j:=0 to high(dane) do
begin
if Tab[i]=StrToInt(dane[j][5])*StrToInt(dane[j][6])-strtoint(dane[j][7]) then
begin
if dane[j][1]='Poznan' then
begin
po:=po+Tab[i];
npo:=npo+1
end;
if dane[j][1]='Warszawa' then
begin
wa:=wa+Tab[i];
nwa:=nwa+1
end;
if dane[j][1]='Wroclaw' then begin
wr:=wr+Tab[i];
nwr:=nwr+1
end;
if dane[j][1]='Szczecin' then begin
sz:=sz+Tab[i];
nsz:=nsz+1
end;
if dane[j][1]='Krakow' then begin
kr:=kr+Tab[i];
nkr:=nkr+1
end;
end;
end;
end;
if npo<>0 then
po:=po/npo;
if nwa<>0 then
wa:=wa/nwa;
if nwr<>0 then
wr:=wr/nwr;
if nsz<>0 then
sz:=sz/nsz;
if nkr<>0 then
kr:=kr/nkr;
if po>wa then
max:=po
else wa:=max;
if wr>max then
max:=wr;
if sz>max then
max:=sz;
if kr>max then
max:=kr;
if max=po then
wynik2[0][0]:='Poznan';
//writeln('Poznan');
if max=wa then
wynik2[0][0]:='Warszawa';
//writeln('Warszawa');
if max=wr then
wynik2[0][0]:='Wroclaw';
//writeln('Wroclaw');
if max=sz then
wynik2[0][0]:='Szczecin';
//writeln('Szczecin');
if max=kr then
wynik2[0][0]:='Krakow';
//writeln('Krakow')
wynik2[0][1]:='tam zarabiono srednio najwiecej, bo';
wynik2[0][2]:=FloatToStr(max);
wynik2[0][3]:='zl';
Result:=wynik2;
end;
function zysk(dane:typ;zespol:string):typ;stdcall;
var
wynik:typ;
s,miasto1,miasto2:string;
i,min,max:integer;
begin
s:=zespol;
min:=high(integer);
for i:=0 to 49 do
if (dane[i][0])=s then
if StrToInt(dane[i][6])<min then
begin
min:=StrToInt(dane[i][6]);
miasto1:=dane[i][1];
end;
for i:=0 to 49 do
if dane[i][0]=s then
if StrToInt(dane[i][5])*StrToInt(dane[i][6])-strtoint(dane[i][7])>max then
begin
max:=StrToInt(dane[i][5])*StrToInt(dane[i][6])-strtoint(dane[i][7]);
miasto2:=dane[i][1];
end;
SetLength(wynik,2);
for i:=0 to 1 do
SetLength(wynik[i],5);
wynik[0][0]:=miasto1;
wynik[0][1]:='tam na';
wynik[0][2]:=s;
wynik[0][3]:='tylko';
wynik[0][4]:=IntToStr(min);
wynik[1][0]:='miejscem najoplacalniejszego koncertu grupy';
wynik[1][1]:=s;
wynik[1][2]:='byl';
wynik[1][3]:=miasto2;
SetLength(Result,1);
SetLength(Result[0],4);
Result:=wynik;
tak wygląda funkcja z którą mam problem