![]() |
Einzelne Werte aus set of-Variable lesen
Hi,
ich habe mir eine einen Set-of-type (oder wie man das nennen mag) deklariert:
Delphi-Quellcode:
Dies verwende ich dann als Property meiner Komponente:
type
TOptions = set of (opAllowUrls, opAllowRelativePaths, opAllowLocalFiles);
Delphi-Quellcode:
Wenn ich jetzt abfragen möchte ob bspw. die Option opAllowUrls Boolean ist kann ich ja nicht einfach if FFileOptions = [opAllowUrls] then .... verwenden, wenn mehrere Optionen ausgewählt werden. Wie könnte ich das anstellen ohne für jede Möglichkeit eine if-Abfrage zu basteln?
private
{ Private-Deklarationen } FFileOptions: TOptions; protected { Protected-Deklarationen } public { Public-Deklarationen } published { Published-Deklarationen } property FileOptions: TOptions read FFileOptions write FFileOptions; |
Re: Einzelne Werte aus set of-Variable lesen
Delphi-Quellcode:
if opAllowUrls in FFileOptions then
|
Re: Einzelne Werte aus set of-Variable lesen
Das war ja einfach :shock:
Danke :mrgreen: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:24 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 by Thomas Breitkreuz