Autor Beitrag
AlA
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Sa 05.04.03 10:55 
Hallo Leute,
Ich wollte eine objektorientierte Array programmien.
Das Problem ist ich weiß nicht welchen Datentyp ich
dabei angeben muss.

wenn raumschiff1 mein Objekt ist;

a : array[1..7] of ???????????;

_________________
ala
fcg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Sa 05.04.03 11:11 
wenn ich dich richtig verstanden habe...

ausblenden Quelltext
1:
a: array [1..7] of traumschiff					


fcg

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
AlA Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Sa 05.04.03 17:44 
Sorry, habe mich nicht ganz klar ausgedrückt:
Ich wollte dann in einer Procedur schreiben:
raumschiff[a].visible:=true;
damit die Images raumschiff1,raumschiff2
raumschiff3 ... raumschiff7 angezeigt werden!

_________________
ala
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 05.04.03 21:24 
a muss eine interger Variable sein, mach mal ein genauers beispiel was du haben willst....

_________________
MFG
Michael Springwald, "kann kein englisch...."
fcg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Sa 05.04.03 21:41 
dann geht es so:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
var
 raumschiff : array [1..7] of TRaumschiff;

....

procedure TForm1.Button1.Click (Sender:Tobject)
 var
 a :integer;
begin
  //mit der for schleife
  for a:=0 to ... do
   raumschiff[a].visible:=false;
  //oder nur für eins
   raumschiff[2].visible:=false;
end;


fcg

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 05.04.03 21:54 
meist du das er sowas gemaint hat ???
wie kommt er denn dabei auf OOP ?

_________________
MFG
Michael Springwald, "kann kein englisch...."
fcg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Sa 05.04.03 22:02 
weil es das gepostet hat

Zitat:
Ich wollte dann in einer Procedur schreiben:
raumschiff[a].visible:=true;
damit die Images raumschiff1,raumschiff2
raumschiff3 ... raumschiff7 angezeigt werden!


habe ich mir das so gedacht. vielleicht weil er raumschiff als eigene objectklasse deklariert hat oder so.

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Sa 05.04.03 22:07 
ich finde er hat es sehr ungenau beschrieben(sein problem)

_________________
MFG
Michael Springwald, "kann kein englisch...."
AlA Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: So 06.04.03 10:06 
Titel: Danke fcg
Danke, Danke.
Das ist genau das was ich gesucht habe!!!
fcg hat es genau richtig verstanden.
Danke

_________________
ala
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: So 06.04.03 16:31 
OK... ich gebe mich geschlagen :shock:

_________________
MFG
Michael Springwald, "kann kein englisch...."