Re: [fpc-pascal] any free pascal standard function to compare a, string against an array of string?

2018-10-10 Thread Ingemar Ragnemalm
You mean something faster than a for-loop? Like a hash table? I don't know of any hash table in the standard library but there are some in the class library: https://www.freepascal.org/docs-html/fcl/contnrs/tfpstringhashtable.html

Re: [fpc-pascal] any free pascal standard function to compare a string against an array of string?

2018-10-10 Thread David Copeland
Dennis, Look at AnsiMatchStr in strutils. Dave. On 2018-10-10 11:11 a.m., Dennis wrote: > is there a function like >   if    IsOneOf('subtext', ['abc','cde','fecg','hig'])   then begin > ... > end; > > is there such a function IsOneOf(TheSubString : String; const > TheStrings : array of String)

Re: [fpc-pascal] any free pascal standard function to compare a string against an array of string?

2018-10-10 Thread OBones
Hello, I would use IndexStr from StrUtils: https://www.freepascal.org/docs-html/rtl/strutils/indexstr.html   if IndexStr('subtext', ['abc','cde','fecg','hig']) >= 0  then Regards Dennis wrote: is there a function like   if    IsOneOf('subtext', ['abc','cde','fecg','hig'])   then begin ...

Re: [fpc-pascal] any free pascal standard function to compare a string against an array of string?

2018-10-10 Thread Michael Van Canneyt
On Wed, 10 Oct 2018, Dennis wrote: is there a function like   if    IsOneOf('subtext', ['abc','cde','fecg','hig'])   then begin ... end; is there such a function IsOneOf(TheSubString : String; const TheStrings : array of String) : Boolean ? if yes, what is its name and unit? IndexStr in

[fpc-pascal] any free pascal standard function to compare a string against an array of string?

2018-10-10 Thread Dennis
is there a function like   if    IsOneOf('subtext', ['abc','cde','fecg','hig'])   then begin ... end; is there such a function IsOneOf(TheSubString : String; const TheStrings : array of String) : Boolean ? if yes, what is its name and unit? Dennis