Recent

Author Topic: Set of strings...  (Read 6715 times)

captian jaster

  • Guest
Set of strings...
« on: June 27, 2010, 10:47:49 am »
is there a certain way of making a set of ANIStrings (eg '.jpg','.JPG') im doing my project again

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1930
Re: Set of strings...
« Reply #1 on: June 27, 2010, 11:21:02 am »
Fill a TStringList, then use IndexOf to see whether the item exists.

mas steindorff

  • Hero Member
  • *****
  • Posts: 553
Re: Set of strings...
« Reply #2 on: June 28, 2010, 03:19:40 pm »
here is a delph help link to tstringlist and how to use and some of what they can do.

http://www.delphibasics.co.uk/RTL.asp?Name=TStringList
windows 10 &11, Ubuntu 21+ IDE 3.4 general releases

Bart

  • Hero Member
  • *****
  • Posts: 5496
    • Bart en Mariska's Webstek
Re: Set of strings...
« Reply #3 on: June 29, 2010, 02:59:29 am »
What are you trying to accomplish?

If you want to know if a filename has an extension like in your example "set", then take a look at MatchesMaskList() in unit masks.

Bart

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11984
  • FPC developer.
Re: Set of strings...
« Reply #4 on: July 05, 2010, 11:22:40 am »
Fill a TStringList, then use IndexOf to see whether the item exists.

Don't forget to set the sorted attribute, it will speedup indexof

 

TinyPortal © 2005-2018