Autor Beitrag
Snippy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61



BeitragVerfasst: Sa 12.10.02 23:36 
Ich hab probleme mit einem if - then clause! :D
Eine Zufallszahl wird in ein editfeld geschrieben.
Ich möchte, dass wenn sie 0 lautet, dass eine neue zufallszahl gewählt wird!
Wie mach ich das??????? :(

(13.10.02 15:00 Tino) Titel geändert und Topic verschoben.

_________________
Carpe Diem!
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 12.10.02 23:39 
Hi!

Evtl. hilft Dir dieser Beitrag weiter. Wenn nicht, dann poste nochmal!

MfG,
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Sa 12.10.02 23:48 
Hi,

hier haste nochmal ein kleines Codebeispiel:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var
  I: Integer;
begin
  Randomize;
  i := Random(100);
  while i = 0 do
  begin
    i := Random(100);
  end;
  Label1.Caption := IntToStr(i);
end;

_________________
Viele Grüße
Jakob
Snippy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61



BeitragVerfasst: So 13.10.02 02:06 
THX :D :D :D :D

_________________
Carpe Diem!
DelphiGuru
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Di 05.11.02 15:42 
Es geht auch so!

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
var i: Integer
begin
  Randomize;
  i := Random(99) + 1;
  Label1.Caption := IntToStr(i); 
end;
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 05.11.02 15:50 
DelphiGuru hat folgendes geschrieben:
Es geht auch so!

Radio Eriwan sagt: Ja. Aber wenn man es ganz genau nimmt: Nein! Denn die Bedingung war ja:
Snippy hat folgendes geschrieben:
Ich möchte, dass wenn sie 0 lautet, dass eine neue zufallszahl gewählt wird!

Also muss man erst mal diese Bedingung erfüllen. Nur, bei deiner Lösung, DelphiGuru, gibt´s aber nie ´ne Null. :wink: :mrgreen:
DelphiGuru
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Di 05.11.02 16:37 
ok
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: Di 05.11.02 19:25 
Noch ein Guru .... :lol:

_________________
If accidentally read, induce vomitting.
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Di 05.11.02 23:12 
jetzt sinn wir schon zwei :beer:

_________________
Viele Grüße
Jakob