Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi kleine frage zu "if abfrage" (https://www.delphipraxis.net/44081-kleine-frage-zu-if-abfrage.html)

Silicium 13. Apr 2005 09:16


kleine frage zu "if abfrage"
 
hiho ich hoffe ihr killt mich jetzt nicht wenn ich son ... frage.


kann mir jemand sagen wieso das nicht funktioniert?

if not wwDBEdit_PWkm.text := '0' and not wwDBEdit_PWkm.text := '' then

danke

[edit=sakura] Personalität eingetragen. Mfg, sakura[/edit]

sakura 13. Apr 2005 09:17

Re: kleine frage zu "if abfrage"
 
Zitat:

Zitat von Silicium
kann mir jemand sagen wieso das nicht funktioniert?

Zu viele Doppelpunkte und zu wenige Klammern :mrgreen:
Delphi-Quellcode:
if (not wwDBEdit_PWkm.text = '0') and (not wwDBEdit_PWkm.text = '') then
...:cat:...

Binärbaum 13. Apr 2005 09:18

Re: kleine frage zu "if abfrage"
 
Zitat:

Zitat von Silicium
hiho ich hoffe ihr killt mich jetzt nicht wenn ich son ... frage.


kann mir jemand sagen wieso das nicht funktioniert?

if not wwDBEdit_PWkm.text := '0' and not wwDBEdit_PWkm.text := '' then

danke

Weil das":=" nur für (Wert-)Zuweisungen verwendet wird. Bei if-Abfragen nimmt man nur "=" (ohne Dopplepunkt davor).

MfG
Binärbaum

//Edit: Ups, da war wohl jemand schneller

glkgereon 13. Apr 2005 09:18

Re: kleine frage zu "if abfrage"
 
bei abfragen nur = und nich :=

;)

ausserdem klammern um die einzel-abfragen

also:
Delphi-Quellcode:
if (not wwDBEdit_PWkm.text = '0') and (not wwDBEdit_PWkm.text = '') then

Silicium 13. Apr 2005 09:18

Re: kleine frage zu "if abfrage"
 
hui ging aber schnell :)

danke vielmals

DP-Maintenance 13. Apr 2005 09:19

DP-Maintenance
 
Dieses Thema wurde von "sakura" von "Programmieren allgemein" nach "Object-Pascal / Delphi-Language" verschoben.
Ist aber schon eine Delphi-Frage ;)

Silicium 13. Apr 2005 09:21

Re: kleine frage zu "if abfrage"
 
hmm geht nicht.

komisch ich frag mal den chef :)

jim_raynor 13. Apr 2005 09:30

Re: kleine frage zu "if abfrage"
 
Da fehlen auch noch ein paar Klammern:

Delphi-Quellcode:
if (not (wwDBEdit_PWkm.text = '0')) and (not (wwDBEdit_PWkm.text = '')) then

Binärbaum 13. Apr 2005 09:31

Re: kleine frage zu "if abfrage"
 
Zitat:

Zitat von Silicium
hmm geht nicht.

komisch ich frag mal den chef :)

Was geht denn nicht?
Evtl. könnte man die Klammerung ändern:
Delphi-Quellcode:
if ((not (wwDBEdit_PWkm.text= '0')) and (not (wwDBEdit_PWkm.text= ''))) then ...
Vielleicht hilft's ja.

MfG
Binärbaum

Silicium 13. Apr 2005 09:45

Re: kleine frage zu "if abfrage"
 
*g*
das hat mein chef auch gesagt :)

danke nochmals


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:47 Uhr.
Seite 1 von 2  1 2      

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