Autor Beitrag
DorJo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 139



BeitragVerfasst: Fr 05.12.08 01:38 
hy @all,
ich hab mal wieder ein Problem! Also folgendes:
meine Prozedur Button.Click ruft eine unterprozedur auf wie folgt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.ButtonClick();
var test:array of string;
begin
  proc2(test);
end;


bei der proc2 möchte ich dann folgendes tun:
ausblenden Delphi-Quelltext
1:
  SetLength(test, 3);					


Aber da kommt die Fehlermeldung "Inkopatiple Typen".

Weiß irgendjemand von euch Rat? Danke schon mal im vorraus!

MfG

DorJo
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 05.12.08 02:04 
Wie sieht denn deine proc2 aus?
DorJo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 139



BeitragVerfasst: Fr 05.12.08 02:08 
procedure proc2(var test:array of string);
begin
SetLength(test, 3);
end;
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 05.12.08 02:45 
Probiers mal so: ;-)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm1.ButtonClick(Sender: TObject);
type
  TStringArray = array of string;

  procedure proc2(var test: TStringArray);
  begin
    SetLength(test, 3);
  end;

var
  test: TStringArray;
begin
  proc2(test);
end;