AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Problemt mit einer if-Abfrage

Ein Thema von Clane · begonnen am 15. Aug 2005 · letzter Beitrag vom 15. Aug 2005
Antwort Antwort
Clane
(Gast)

n/a Beiträge
 
#1

Problemt mit einer if-Abfrage

  Alt 15. Aug 2005, 07:58
also ich habe folgendes programmiert

if not command = 'shutdownand not command = 'lockwstthen showmessage(msg) der sinn:: wenn command nich = shutdown ist und gleichzeitig aber auch nich = lockwst ist soll eine shwomessage angezeigt werden

mein compiler mäckert aber und zwar das hier

Zitat:
[Error] Unit1.pas(46): E2015 Operator not applicable to this operand type
[Error] Unit1.pas(46): E2015 Operator not applicable to this operand type
[Warning] Unit1.pas(46): W1023 Comparing signed and unsigned types - widened both operands
[Error] Unit1.pas(46): E2010 Incompatible types: 'string' and 'Boolean'
[Fatal Error] Server.dpr(5): F2063 Could not compile used unit 'Unit1.pas'
  Mit Zitat antworten Zitat
Benutzerbild von turboPASCAL
turboPASCAL

Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
 
Delphi 6 Personal
 
#2

Re: Problemt mit einer if-Abfrage

  Alt 15. Aug 2005, 08:04
if not (command = 'shutdown') and not (command = 'lockwst') then Klammern nicht vergessen !
Matti
Meine Software-Projekte - Homepage - Grüße vom Rüsselmops -Mops Mopser
  Mit Zitat antworten Zitat
Benutzerbild von Sharky
Sharky

Registriert seit: 29. Mai 2002
Ort: Frankfurt
8.251 Beiträge
 
Delphi 2006 Professional
 
#3

Re: Problemt mit einer if-Abfrage

  Alt 15. Aug 2005, 08:15
Hai PBiggi,

wenn ich dich richtig verstehe soll die Meldung kommen wenn command nicht "shutdown" oder "lockwst" ist?

dann könntest Du das auch so mache:
 if not ((command = 'shutdown') or (command = 'lockwst')) then Ist so einfach finde ich.
Stephan B.
"Lasst den Gänsen ihre Füßchen"
  Mit Zitat antworten Zitat
Clane
(Gast)

n/a Beiträge
 
#4

Re: Problemt mit einer if-Abfrage

  Alt 15. Aug 2005, 08:17
genau und danke so funktionierts
  Mit Zitat antworten Zitat
Benutzerbild von RavenIV
RavenIV

Registriert seit: 12. Jan 2005
Ort: Waldshut-Tiengen
2.875 Beiträge
 
Delphi 2007 Enterprise
 
#5

Re: Problemt mit einer if-Abfrage

  Alt 15. Aug 2005, 08:54
Zitat von Sharky:
dann könntest Du das auch so mache:
 if not ((command = 'shutdown') or (command = 'lockwst')) then
ist doch das gleiche wie
if (command <> 'shutdown') and (command <> 'lockwst') then aber viel leichte zu durchschauen.
Klaus E.
Linux - das längste Text-Adventure aller Zeiten...
Wer nie Linux mit dem vi konfiguriert hat, der hat am Leben vorbei geklickt.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:01 Uhr.
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