Autor Beitrag
Trainman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

XP

BeitragVerfasst: Mi 26.11.03 08:15 
hallo leute,

ich habe eine Frage zwar
ausblenden volle Höhe 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:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
var c,d :string;
procedure TForm1.FormCreate(Sender: TObject);
begin
c:='ein Wort';
d:='zweites wort';
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.Text:=c and edit2.tex:=d then form2.show;
end;

end.


der code mit if edit1.text:=c .....
stimmt offenbar nicht. Kann jemand mir helfen.
Danke
TTrainman[/quote]
ShadowThief
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278



BeitragVerfasst: Mi 26.11.03 08:19 
hi,

du fragst auf eine variable ab, in diesem fall edit1.text.
bei abfragen verwendet man den = operator.
der := operator wird nur bei zuweisungen verwendet.

also einfach die zwei doppelpunkte rausmachen.

shadow.

_________________
"soylent grün ist menschenfleisch!"
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mi 26.11.03 09:12 
und vieleicht das nächste mal in die richtige sparte posten, ist zwar nich so schlimm, aber es verwirrt^^

also was shadow geschrieben hat stimmt schon nur darfst du bei verknüpften bedingungen die klammern nicht vergessen!
Hier nochmal richtig:

ausblenden Delphi-Quelltext
1:
if (Edit1.Text = c) and (Edit2.Text = d) then form2.show;					

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce