Autor Beitrag
dako
Hält's aus hier
Beiträge: 1



BeitragVerfasst: Fr 08.02.08 08:01 
Hab mal ne Frage. Wie würde Konkret ein Feld in diesem Beispiel aussehen?


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:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ComCtrls;

type
  TForm1 = class(TForm)
    LBZufallszahlen: TListBox;
    LBfilter: TListBox;
    Panel1: TPanel;
    Label1: TLabel;
    EZ: TEdit;
    Label2: TLabel;
    Label3: TLabel;
    Start: TButton;
    LB7: TListBox;
    Label4: TLabel;
    procedure StartClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.StartClick(Sender: TObject);
var n, i, zz:integer;
begin
  LBZufallszahlen.Clear;
  LBfilter.Clear;
  LB7.Clear;
  n:= strToInt(EZ.Text);
  for i:= 1 to n do
   begin
     zz:= Random(90)+10;
     LBZufallszahlen.Items.Add(IntToStr(zz));
     if zz mod 7 = 0
       then LBfilter.Items.Add(IntToStr(zz));
     if zz mod 10 = 7
       then LB7.Items.Add(IntToStr(zz));
     if zz div 10=7
       then LB7.Items.Add(IntToStr(zz));

   end
end;

end.




DANKE!

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Fr 08.02.08 08:34 
Hä, was denn für ein Feld :?: :?:

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 08.02.08 10:32 
Bitte nicht gleich so deskriptiv im Titel ;-) Da weiß doch keiner, worum es bei Dir gehen soll.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Fr 08.02.08 21:30 
user profile icondako hat folgendes geschrieben:
Hab mal ne Frage. Wie würde Konkret ein Feld in diesem Beispiel aussehen?


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:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, ComCtrls;

type
  TForm1 = class(TForm)
    LBZufallszahlen: TListBox;
    LBfilter: TListBox;
    Panel1: TPanel;
    Label1: TLabel;
    EZ: TEdit;  //Felder: Variablen im Objekt. Sollten private deklariart werden. Direkter Zugriff ist unsauber.
    Label2: TLabel;
    Label3: TLabel;
    Start: TButton;
    LB7: TListBox;
    Label4: TLabel;
    procedure StartClick(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.StartClick(Sender: TObject);
var n, i, zz:integer;
begin
  LBZufallszahlen.Clear;
  LBfilter.Clear;
  LB7.Clear;
  n:= strToInt(EZ.Text);
  for i:= 1 to n do
   begin
     zz:= Random(90)+10;
     LBZufallszahlen.Items.Add(IntToStr(zz));
     if zz mod 7 = 0
       then LBfilter.Items.Add(IntToStr(zz));
     if zz mod 10 = 7
       then LB7.Items.Add(IntToStr(zz));
     if zz div 10=7
       then LB7.Items.Add(IntToStr(zz));

   end
end;

end.




DANKE!

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)