Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.168 Beiträge
 
Delphi 12 Athens
 
#3

AW: if-schleife mit mehreren kriterien

  Alt 14. Jul 2010, 09:25
Delphi-Quellcode:
if not ((Notification_Mail_Priority = 'pHighest')
    or (Notification_Mail_Priority = 'pHigh')
    or (Notification_Mail_Priority = 'pNormal')
    or (Notification_Mail_Priority = 'pLow')
    or (Notification_Mail_Priority = 'pLowest')) then
  begin
    ........
  end;
Delphi-Quellcode:
if (Notification_Mail_Priority <> 'pHighest')
    and (Notification_Mail_Priority <> 'pHigh')
    and (Notification_Mail_Priority <> 'pNormal')
    and (Notification_Mail_Priority <> 'pLow')
    and (Notification_Mail_Priority <> 'pLowest')) then
  begin
    ........
  end;
oder
Delphi-Quellcode:
uses StrUtils;

if not MatchStr(Notification_Mail_Priority, ['pHighest', 'pHigh', 'pNormal', 'pLow', 'pLowest']) then
  begin
    ........
  end;
PS: www.if-schleife.de

[edit]
meinte das casesensitive MatchStr und nicht MatchText.
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat