Einzelnen Beitrag anzeigen

Benutzerbild von Jarie
Jarie

Registriert seit: 28. Feb 2006
Ort: Deutschland
17 Beiträge
 
Delphi 7 Professional
 
#33

Re: if...then...else

  Alt 22. Mai 2006, 19:18
Was das bewirken soll? siehe Anfang des Threads Oo. ^^

Na ja, hab jetzt allet umstrukturiert, jetzt meckert er wegen dem Punkt am Ende xDDD.

Delphi-Quellcode:
unit rechnen;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    Button9: TButton;
    Button10: TButton;
    Button11: TButton;
    Button12: TButton;
    Button13: TButton;
    Button14: TButton;
    Button15: TButton;
    Label1: TLabel;
    MainMenu1: TMainMenu;
    Datei1: TMenuItem;
    Beenden1: TMenuItem;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Beenden1Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
    procedure Button9Click(Sender: TObject);
    procedure Button10Click(Sender: TObject);
    procedure Button11Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  CurrentLabel: TLabel;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Label1.Caption:= Form1.Label1.Caption + '1';
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Form1.Label1.Caption:= Form1.Label1.Caption + '2';
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Form1.Label1.Caption:= Form1.Label1.Caption + '3';
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
Form1.Label1.Caption:= Form1.Label1.Caption + '4';
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
Form1.Label1.Caption:= Form1.Label1.Caption + '5';
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
Form1.Label1.Caption:= Form1.Label1.Caption + '6';
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
Form1.Label1.Caption:= Form1.Label1.Caption + '7';
end;

procedure TForm1.Button8Click(Sender: TObject);
begin
Form1.Label1.Caption:= Form1.Label1.Caption + '8';
end;

procedure TForm1.Button9Click(Sender: TObject);
begin
Form1.Label1.Caption:= Form1.Label1.Caption + '9';
end;

procedure TForm1.Button10Click(Sender: TObject);
begin
Form1.Label1.Caption:= Form1.Label1.Caption + '0';
end;

procedure TForm1.Button11Click(Sender: TObject);
begin
CurrentLabel:=Label5;
CurrentLabel.Caption:= Form1.Label1.Caption;
Form1.Label1.Caption:= '';
end;

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

begin
if (Form1.Label5.Caption='') then
begin
Form1.Label1.Caption:=Form1.Label5.Caption;
end
else
begin
Form1.Label1.Caption:=Form1.Label6.Caption;
end;
end

end.
Das ist jetzt mal die gesamte Anwendung, mal sehen, ob ihr was rauskriegt ^^.
  Mit Zitat antworten Zitat