Autor Beitrag
1_of_1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35


Delphi 5
BeitragVerfasst: Mi 14.06.06 14:30 
kann mir jemand helfen?
ich kann das Formular nicht mehr öffnen und mir wird immer die fehlermeldung Ressource TForm1 nicht gefunden angezeigt.
Mögliche Fehlerquellen?
1_of_1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35


Delphi 5
BeitragVerfasst: Mo 19.06.06 05:04 
Hat niemand eine Idee?
Hier mal der Quelltext (ist vielleicht nicht schön, müsste meiner Meinung nach aber funktionieren, was er aber nicht tut):

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:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;
Const

 Gewinn : array[1..8,1..3] of Integer = ((0,1,2),(3,4,5),(6,7,8),
                                         (0,3,6),(1,4,7),(2,5,8),
                                         (0,4,8),(2,4,6));

 type
  Form1 = class(TForm)
    Button0: TButton;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    Button9: TButton;
    Label2: TLabel;

    procedure ButtonClick(Sender: TObject);
    procedure Button9Click(Sender: TObject);

  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;
 Feld = (Unbelegt, Kreuz, Kreis);

 var
  Form1: TForm1;
 Spielfeld : Array[0..8] of Feld;
 Spieler1 : Boolean;
{z:integer;}

implementation


procedure TForm1.ButtonClick(Sender: TObject);
Var
 I : Integer;
 KreuzGewinnt, KreisGewinnt : Boolean;
begin
{z:=z+1}
 with TButton(Sender) do
 begin
  if Spielfeld[Tag] = unbelegt then
  begin
   if Spieler1 then
   begin
    Spielfeld[Tag] := Kreuz;
    Caption := 'X';
   end else
   begin 
    Spielfeld[Tag] := Kreis;
    Caption := 'O';
   end; 
   Spieler1 := not Spieler1;
  end else
   ShowMessage('Dieses Feld kann nicht mehr belegt werden!');
  KreuzGewinnt := False; 
  KreisGewinnt := False; 
  For I := 1 to 8 do
  begin
   KreuzGewinnt := KreuzGewinnt or ((Spielfeld[Gewinn[I,1]]=Kreuz)and
                                    (Spielfeld[Gewinn[I,2]]=Kreuz)and
                                    (Spielfeld[Gewinn[I,3]]=Kreuz));
   KreisGewinnt := KreisGewinnt or ((Spielfeld[Gewinn[I,1]]=Kreis)and
                                    (Spielfeld[Gewinn[I,2]]=Kreis)and
                                    (Spielfeld[Gewinn[I,3]]=Kreis));
  end;
  if KreuzGewinnt then begin
                       ShowMessage('Gratulation, Kreuz Gewinnt!');
                       Spielfeld[0]:=unbelegt;
                       Button0.caption:='';
                       Spielfeld[1]:=unbelegt;
                       Button1.caption:='';
                       Spielfeld[2]:=unbelegt;
                       Button2.caption:='';
                       Spielfeld[3]:=unbelegt;
                       Button3.caption:='';
                       Spielfeld[4]:=unbelegt;
                       Button4.caption:='';
                       Spielfeld[5]:=unbelegt;
                       Button5.caption:='';
                       Spielfeld[6]:=unbelegt;
                       Button6.caption:='';
                       Spielfeld[7]:=unbelegt;
                       Button7.caption:='';
                       Spielfeld[8]:=unbelegt;
                       Button8.caption:='';
                       end;
  if KreisGewinnt then
                      begin
                      ShowMessage('Gratulation, Kreis Gewinnt!');
                      Spielfeld[0]:=unbelegt;
                       Button0.caption:='';
                       Spielfeld[1]:=unbelegt;
                       Button1.caption:='';
                       Spielfeld[2]:=unbelegt;
                       Button2.caption:='';
                       Spielfeld[3]:=unbelegt;
                       Button3.caption:='';
                       Spielfeld[4]:=unbelegt;
                       Button4.caption:='';
                       Spielfeld[5]:=unbelegt;
                       Button5.caption:='';
                       Spielfeld[6]:=unbelegt;
                       Button6.caption:='';
                       Spielfeld[7]:=unbelegt;
                       Button7.caption:='';
                       Spielfeld[8]:=unbelegt;
                       Button8.caption:='';
                       end;
 end;
{if z=9
then begin             Spielfeld[0]:=unbelegt;
                       Button0.caption:='';
                       Spielfeld[1]:=unbelegt;
                       Button1.caption:='';
                       Spielfeld[2]:=unbelegt;
                       Button2.caption:='';
                       Spielfeld[3]:=unbelegt;
                       Button3.caption:='';
                       Spielfeld[4]:=unbelegt;
                       Button4.caption:='';
                       Spielfeld[5]:=unbelegt;
                       Button5.caption:='';
                       Spielfeld[6]:=unbelegt;
                       Button6.caption:='';
                       Spielfeld[7]:=unbelegt;
                       Button7.caption:='';
                       Spielfeld[8]:=unbelegt;
                       Button8.caption:='';
     end;}


end;

procedure TForm1.Button9Click(Sender: TObject);
begin
Form1.Close;
end;

end.
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mo 19.06.06 06:08 
Doch ich hab eine Idee, weiß aber nicht ob es das ist:

unter implemtation steht ja noch {$R *.dfm}. Das ist ja eine Resource. Vielleicht hast du also versehentlich die dfm-Datei gelöscht oder verschoben?

Deinen Fehler hatte ich aber noch nicht, deshalb ist das nur eine Vermutung;
1_of_1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35


Delphi 5
BeitragVerfasst: Mo 19.06.06 14:21 
Das ist es! Danke!