Autor Beitrag
buSC
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Mo 11.01.10 11:50 
hallo liebe forumer,
ich habe so aehnliche procedure:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure proc(var input_arr:array of double;var output_arr:array of double);
var
begin
  setlength(output_arr,length(input_arr));
  ...
end;

wobei input_arr sind als eingabe und output_arr ist als ausgabe betrachtet.
dh: output_arr muss eine laenge wie input_arr haben und das wird die ergebnisse nach einer prozess auf input_arr beinhalten.
aber ich bekomme den fehler "incompatible types " und wenn ich die zeile von setlength
kommentiere ,dann gibts diese Fehler nicht ,warum?
danke im Voraus

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 480

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 11.01.10 12:01 
Probier mal, dein Array vorher als Typ zu definieren, also so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
type TDoubleArray = Array of Double;

/// ....

procedure proc(var input_arr: TDoubleArray; var output_arr: TDoubleArray);

_________________
We are, we were and will not be.
buSC Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Di 12.01.10 16:58 
vielen dank
es hat gekklapt,aber freu mich zu wissen ,was der Grund des Problems war.
vilen Dank nochmal.
:)