Autor Beitrag
optikandy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Do 17.05.07 13:48 
hallo leute,

ich mache gerade in informatik delphi in der schule, und probiere desshalb ein bisschen zuhause rum. da traten schon die ersten probleme auf^^ ich wollt, dass er mir 3 zahlen anzeigt, aber nicht gleichzeitig, sondern etwas zeitversetzt. wie kann ich das machen???

meldet euch bitte

danke

andy


Moderiert von user profile iconChristian S.: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Do 17.05.2007 um 13:50
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Do 17.05.07 14:03 
Sieh dir mal diesen Thread an, der sollte dir weiterhelfen.
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Do 17.05.07 14:46 
Ein deinem Falle also:
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:
procedure Delay(X: Integer);
var  
  t: Integer;  
begin  
  t := GetTickCount;  
  while (GetTickCount - t) < X do  
  begin  
    Sleep(10);  
    Application.ProcessMessages;  
  end;  
end;

procedure TForm1.Button1Click(Sender: TObject); 
var 
  zahl1: Integer; 
  zahl2: Integer; 
  zahl3: Integer; 
begin 
  randomize; 
  zahl1 := random(5) + 1
  zahl2 := random(5) + 1
  zahl3 := random(5) + 1
  case zahl1 of 
    1: zahl1 := 50
    2: zahl1 := 100
    3: zahl1 := 50
    4: zahl1 := 100
    5: zahl1 := 50
  end
  case zahl2 of 
    1: zahl2 := 50
    2: zahl2 := 100
    3: zahl2 := 50
    4: zahl2 := 100
    5: zahl2 := 50
  end
  case zahl3 of 
    1: zahl3 := 50
    2: zahl3 := 100
    3: zahl3 := 50
    4: zahl3 := 100
    5: zahl3 := 50
  end
  L_ZAHL1.Caption := IntToStr(zahl1); 
  Delay(2000);
  L_ZAHL2.Caption := IntToStr(zahl2); 
  Delay(2000);
  L_ZAHL3.caption := IntToStr(zahl3);
end;


user profile iconoptikandy hat folgendes geschrieben:
ps. wie mach ich, dass er den delphi-code erkennt???

[delphi]Dein Quelltext..[/delphi]

Übrigens: Randomize sollte immer nur einmal beim Starten des Programmes aufgerufen werden, nicht bei jedem Klick auf den Button. Deswegen am besten das Randomize in OnCreate verschieben.


Zuletzt bearbeitet von Chryzler am Do 17.05.07 14:53, insgesamt 1-mal bearbeitet
optikandy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20



BeitragVerfasst: Do 17.05.07 14:52 
gut^^

danke :D

klappt super