Autor Beitrag
Zombimode
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

Win 98, Win XP

BeitragVerfasst: Do 28.10.04 17:46 
Das verwundert mich jetzt schon.
Warum sind das
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
type
   t_item = RECORD
        [...]
   t_figur = RECORD
        [...]
        Inventar :array of t_item;

var
spieler :t_figur;
gegenstand :array of t_item;

begin
if spieler.Inventar[x] = Gegenstand[y] then ...

inkompatible Typen
und wieso das nicht:
ausblenden Delphi-Quelltext
1:
if spieler.Inventar[x].Name = Gegenstand[y].Name then ...					


*ratlos ist* :?
Luzzifus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 200

Win2K
D6 Prof
BeitragVerfasst: Do 28.10.04 17:51 
weil t_item und t_figur offensichtlich unterschiedliche record typen sind, spieler.Inventar[x].Name und Gegenstand[y].Name jedoch jeweils nur ein teil der records sind und somit ihren eigenen typ haben (string nehm ich mal an). da das der gleiche sein wird, sind sie nicht inkompatibel, aber zwei unterschiedlich definierte record typen sind bezüglich der zuweisung latürnich inkompatibel.
Zombimode Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

Win 98, Win XP

BeitragVerfasst: Do 28.10.04 17:57 
hm, ich dachte, weil Inventar ja auch t_item ist, könne man das vergleichen
egal, dann gibts halt noch ne eigenschaft "ID" und alles ist geregelt

Danke für die Aufklärung :-)