Hi yozuca,
I think the problem is that you try to assign to that real entity(a[L]) the result of the function. "sort" function has two parameters, so the correct assignment would be :
a[L] := sort(FirstParameter, SecondParameter); here you call the function.
I suggest to use a local variable of type real.
function Sort(L, R:integer):real;
var
Temp : real;
begin
for L:= L to R-1 do
if A[L]<A[L+1] then begin
Temp:=A[L+1];
A[L+1]:=A[L];
A[L]:=Temp;
end;
sort := 1; //another suggestion is to use a procedure instead of a function. A function is usefull when you have to return a value.
end;
Ionut
Ionelul
Junior Poster in Training
94 posts since Dec 2009
Reputation Points: 17
Solved Threads: 27