Autor Beitrag
THF
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

Vista
Delphi 2005 professional
BeitragVerfasst: Sa 26.02.05 21:48 
Hallo,
ich habe eine selbstdefinierte Procedure
geschrieben, bei der auf BitBtnClick eine Figur (Image)
an eine bestimmten Position gestellt wird.
Erhalte aber leider immer eine Fehlermeldung,daß
"Typen der tatsächlichen und formalen Var-Parameter
müssen übereinstimmen"
Finde leider keinen Fehler.
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
var  Feld :TFeld;
  von_Feld,nach_Feld :Integer;
...........
 procedure TProgramm.Figuren_ziehen(var  von_Feld, nach_Feld :Integer;var FigurImage: TImage );
begin
case von_Feld of
1..8 : YLinks:= 416;
9..16 :YLinks:= 360;
17..24 :YLinks := 304;
25..32 :YLinks := 248;
33..40 : YLinks := 192;
41..48 :YLinks := 136;
49..56 :YLinks := 80;
57..64 :YLinks := 24 ; end;
case von_Feld of
1,9,17,25,33,41,49,57 :XLinks := 22;
2,10,18,26,34,42,50,58 :XLinks := 77;
3,11,19,27,35,43,51,59 :XLinks := 134;
4,12,20,28,36,44,52,60 :XLinks := 190;
5,13,21,29,37,45,53,61 :XLinks := 246;
6,14,22,30,38,46,54,62 :XLinks := 302;
7,15,23,31,39,47,55,63 :XLinks := 358;
8,16,24,32,40,48,56,64 :XLinks := 416;
end;
case nach_Feld of
1..8 : YLinks:= 416;
9..16 :YLinks:= 360;
17..24 :YLinks := 304;
25..32 :YLinks := 248;
33..40 : YLinks := 192;
41..48 :YLinks := 136;
49..56 :YLinks := 80;
57..64 :YLinks := 24 ; end;
case nach_Feld of
1,9,17,25,33,41,49,57 :XLinks := 22;
2,10,18,26,34,42,50,58 :XLinks := 77;
3,11,19,27,35,43,51,59 :XLinks := 134;
4,12,20,28,36,44,52,60 :XLinks := 190;
5,13,21,29,37,45,53,61 :XLinks := 246;
6,14,22,30,38,46,54,62 :XLinks := 302;
7,15,23,31,39,47,55,63 :XLinks := 358;
8,16,24,32,40,48,56,64 :XLinks := 416;
end;
FigurImage.SetBounds(XLinks,YLinks,FigurBreite,FigurHoehe);
end;
procedure TProgramm.BitBtn1Click(Sender: TObject);
begin

Figuren_ziehen(12 ,28,Figur4);
end;

Wenn ich dagegen schreibe :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TProgramm.BitBtn1Click(Sender: TObject);
begin
von_Feld:=12;
nach_Feld:=28;
Figuren_ziehen(von_Feld,nach_Feld,Figur4);
end;

funktioniert es

Gruß

THF
Dominique
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 92



BeitragVerfasst: Sa 26.02.05 21:58 
du hast dir die antwort auf deine frage schon selbst gegeben,
da du in deiner prozedur die parameter "von_Feld" und "nach_Feld" als var deklariert hast,
kannst du keine konstanten übergeben.