Autor Beitrag
chrissivo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 130

WIN XP, WIN 2000, WIN MCE, WIN 98
D5 Pers
BeitragVerfasst: Mo 26.09.05 20:46 
Hallihallo,
ich habe ein ähnliches Problem, wie dieses hier :www.delphi-forum.de/viewtopic.php?t=38269
Ich möchte also ein Array komplett mit Werten befüllen, will aber keine Konstanten belgen!

Ich will in Abhängigkeit eines Parameters i : Integer ein matrix : Array[1..3,1..4] of Boolean füllen.

Hatte es mit:
ausblenden Delphi-Quelltext
1:
2:
3:
case i of
1 : matrix[1] := (true, true, true, false)
end;


wenigstens sinngemäß, doch erfolglos versucht.
Wer kann mir helfen???

Vielen Dank im Vorraus

Chrissi

_________________
"... was ich noch zu sagen hätte dauert eine Zigarette, und ein letztes Glas im Steh'n..."
Grishnak
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 221

Windows XP Home
Delphi 7 PE, Delphi 2005 PE
BeitragVerfasst: Mo 26.09.05 21:16 
Über eine Funktion klappt es so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
type
  TMatrixLine = array[1..4] of boolean;

var
  matrix: array[1..3] of TMatrixLine;

function MatrixLine(const a, b, c, d: boolean): TMatrixLine;
begin
  Result[1]:=a;
  Result[2]:=b;
  Result[3]:=c;
  Result[4]:=d;
end;

[..]

  matrix[1]:=MatrixLine(true, true, true, false);
chrissivo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 130

WIN XP, WIN 2000, WIN MCE, WIN 98
D5 Pers
BeitragVerfasst: Di 27.09.05 19:54 
Hallo,
danke für die schnelle Antwort. Ich habe es ausprobiert. Funktioniert zwar, hatte aber gehofft, es würde eine einfachere Möglichkeit geben.
Hat noch jemand Rat?

Danke

Chrissi

_________________
"... was ich noch zu sagen hätte dauert eine Zigarette, und ein letztes Glas im Steh'n..."