[Lazarus] About TComboBox.Items.IndexOfName

FreeMan freeman35 at delphiturkiye.com
Thu Oct 31 11:13:52 CET 2013


Thank you very much Sven,
IndexOf function work correctly


31-10-2013 12:01 tarihinde, Sven Barth yazd─▒:
> Am 31.10.2013 10:56, schrieb FreeMan:
>> No any  non-ASCII characters,
>> 'Admin', 'xxxxx' this to strings added in items
>> TmpStr:= 'Admin'
>> I := EDT_User.Items.IndexOfName(TmpStr);
>> or
>> I := EDT_User.Items.IndexOfName('Admin');
>> same result
>>
> Ah, wait. Now I get your problem. You need to use "IndexOf" instead of 
> "IndexOfName". The latter is for cases where the TStrings instance 
> contains name-value pairs (like "Foobar=blubb") whereby this will 
> return the index of the name-value pair with name "Foobar". For your 
> case you need to use "IndexOf" which checks the complete string.
>
> Regards,
> Sven
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>





More information about the Lazarus mailing list