Autor Beitrag
Nerdus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19

WIN XP (Home)
Delphi 7
BeitragVerfasst: Sa 16.06.07 15:55 
Ich such einen Befehl, welcher eine Form schließt und damit einfach abbricht. ALso soll somit kein Befehl mehr, die nach dem Abbruchbefehl stehen, ausgeführt werden.
Nach dem Abbruchbefehl (den ich suche ;) ) soll sich eine neue Form auf machen und dann nur noch die Befehle von der Form2 annehmen.

EDIT: 2.Frage steht im zweiten Comment von mir!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure score;
begin
Form2.show;
end;



procedure fragen;
if fragenzahl=5 then score // hier passiert der Fehler, dass er die Form2 nicht richtig anzeigt!
else

x:=random(5)+1;
  if xwerte[x]=1 then fragen
  else

if x=1 then
      begin...


Die Variable "fragenzahl" wird im Hauptprogramm immer größer bis es 5 animmt (Anzahl der gekommenen Fragen).
Danke für Hilfe :)


Zuletzt bearbeitet von Nerdus am Sa 16.06.07 19:12, insgesamt 2-mal bearbeitet
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 16.06.07 16:47 
Nach dem 1. else muss ein begin hin. Bitte den Source korrekt formatieren.

ausblenden Beispiel
1:
2:
3:
4:
5:
6:
7:
8:
if X = Y then
begin
  X := Y;
end
else
begin
  Y := X;
end;

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Nerdus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19

WIN XP (Home)
Delphi 7
BeitragVerfasst: Sa 16.06.07 19:12 
ANgenommen ich hab eine Variable "punkte" die den Wert 5 hat (in form1)... nun will ich diesen Wert in einem Label in form2 ausgeben. wie mach ich das? punkte ist bei mir global deklariert! bitte um erneute hilfe^^

EDIT: mit "Label1.Caption:=inttostr(punkte);" hab ich schon versucht aber da spuckt der immer den Wert 0 aus!
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 17.06.07 08:20 
Deklariers mal unter public in Form1 und greif dann mit Form1.Punkte darauf zu.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Nerdus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19

WIN XP (Home)
Delphi 7
BeitragVerfasst: So 17.06.07 09:49 
WIe muss ich das dort deklarieren?

ich hab jetzt unter public "var punkte : integer;" eingegeben und da zeigt der mir schon ein Fehler an!

Und der Zugriff auf Form2 erfolgt dann so: label1.caption:=inttostr(Form1.punkte); ??

Danke im vorraus!
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 17.06.07 12:20 
Einfach das var weglassen. Jap, dann mit Form1.Punkte.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)