Autor Beitrag
thaflo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

Zeta, Mandrake 9.1,Windoof XP
DELPHI 5
BeitragVerfasst: Mo 31.05.04 11:51 
Hallo!
wie kann ich denn einen statischen array mit von mir bestimmten farben füllen?
alse:

var colors:array[???] of TColor;

wieso kann ich nicht das so schreiben?

var colors:array[clRed,clYellow,clBlue] of TColor;

danke der hilfe,
florian


Moderiert von user profile iconPeter Lustig (17:34:17, 31.05.2004): Topic verschoben

_________________
Jeder braucht die Zeit, die Zeit zum Lernen, man kommt nicht auf die Welt und sieht die Dinge wie sie sind....(onkelz)
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mo 31.05.04 16:20 
Hallo,

so müsste es gehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
type
  TMyRGB=(rot, gruen, blau);

  TMyColorArr=array[TMyRGB] of TColor;

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mo 31.05.04 18:04 
eher so:

ausblenden Delphi-Quelltext
1:
var colors:array[0..2] of TColor = (clred, clblue, clgreen);					


Aber nur für globale Variablen
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 31.05.04 18:49 
Wenn man das ganze als const deklariert geht es auch lokal..!

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!