Ross
There was an article 'Sets to Strings, and Back' on
https://www.delphizine.com/
but its now a members only article (I have source code if you want)
You can then use do a 'Extension in AudioFiles' type thing but it would be
AudioFiles = [afWAV, afMP3, afOGG]
if StringInSet('af'+Extention,AudioFiles] then
you other (more OO approach) is to
TAudioFiles = class -- and implement a class method
HTH
Neven
----- Original Message -----
From: "Ross Levis" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Wednesday, 1 August 2001 23:41
Subject: [DUG]: Sets of Strings?
> A beginners Pascal question here:
>
> Is there a better way of doing this?
> If (Extension='.wav' or Extension='.mp3' or Extension='.ogg') then ...
>
> Is there something similar to a Set I can use that would let me write
> something like this?
> If Extension in AudioFiles then ...
>
> I tried Pos(Extension,AudioFiles)>0 but an extension of '.w' would also
> be true.
>
> Another question. Is it quicker to add many items to a TStringList
> unsorted and then Sort it; or set Sorted True & sort each item as it is
> added? Or is there no difference?
>
> Cheers,
> Ross.
>
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/