Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi if-Anweisung mit "and" ?!? (https://www.delphipraxis.net/5298-if-anweisung-mit.html)

Trouble_Maker 31. Mai 2003 18:12


if-Anweisung mit "and" ?!?
 
Hiho hab mal ne Frage:

wieso klappt das nicht :

Code:
if edit1.text = Passwort then showmessage('richtiges Passwort')
and label1.caption := 'richtiges Passwort'

else showmessage('falsches Passwort');
also ich will, wenn das richtige passwort eingegeben wurde 2 oder mehrere Hinweise dazu bringen!

muss ich das so machen ?!?

Code:
if edit1.text = Passwort then showmessage('richtiges Passwort');
if label1.text = Passwort then label1.caption := 'richtiges Passwort'

else showmessage('falsches Passwort');
geht doch einfacher oder ?!?

danke


Trouble_Maker

[edit=Daniel B]Doppelpost gelöscht. Nur einmal auf Absenden klicken! ;) Danke. MfG Daniel B.[/edit]

Stanlay Hanks 31. Mai 2003 18:14

Du müsstest es nur leicht abändern

Delphi-Quellcode:
if edit1.text = Passwort then
begin
showmessage('richtiges Passwort');
(label1.caption := 'richtiges Passwort' )
end
else showmessage('falsches Passwort');

jbg 31. Mai 2003 18:14

Re: if-Anweisung mit "and" ?!?
 
Zitat:

Zitat von Trouble_Maker
Code:
if edit1.text = Passwort then showmessage('richtiges Passwort')
and label1.caption := 'richtiges Passwort'

else showmessage('falsches Passwort');

Das wäre ja eine Programmiererei, wenn man einen Block von Befehlen mit AND verknüpfen müsste.

Tipp: Schon mal was von begin und end; gehört?

Trouble_Maker 31. Mai 2003 18:16

hiho

ah cool danke...


lol ne was is denn bitte "begin" und "end" ??? ;-)


Trouble_Maker

n00b_on_knees 31. Mai 2003 18:43

anfang und ende ;)


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:49 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz