Recent

Author Topic: [SOLVED] CaseInsenstive  (Read 375 times)

Centauri

  • New Member
  • *
  • Posts: 25
[SOLVED] CaseInsenstive
« on: April 05, 2020, 04:07:43 pm »
So, playing with TDbf functions, and I find that setting the ixCaseInsensitive option in a dBase index doesn't work, and the loCaseInsensitive option of the locate() function also doesn't work.

I found in the Lazarus Tdbf Tutorial, the following : "Indexing a DBase file with [ixCaseInsensitive] currently does not work."

Not knowing how old this tutorial is, has a fix or workaround been implemented for these issues? or is a fix ever likely to happen?

Both are a cause for concern in my application.
« Last Edit: April 07, 2020, 03:14:36 pm by Centauri »

jamie

  • Hero Member
  • *****
  • Posts: 3242
Re: CaseInsenstive
« Reply #1 on: April 05, 2020, 04:22:42 pm »
isn't that data base format self supporting in Laz/Fpc ? I mean the code for it should be there.

maybe a fix..?
The only true wisdom is knowing you know nothing

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8555
  • FPC developer.
Re: CaseInsenstive
« Reply #2 on: April 05, 2020, 04:38:56 pm »
tdbf mostly thrives on contributions now, which happens with a frequency of once or twice an year.

winni

  • Hero Member
  • *****
  • Posts: 1567
Re: CaseInsenstive
« Reply #3 on: April 05, 2020, 04:40:26 pm »
Hi!

As far as I remember the dbase field-names an indexes were all upcase by default.

Winni

jamie

  • Hero Member
  • *****
  • Posts: 3242
Re: CaseInsenstive
« Reply #4 on: April 05, 2020, 05:26:14 pm »
I can see where this would cause an issue. If you were to index the data base ignoring case then this would mean that all found instances would just be stacked one after the other.

 Putting this in prospective it also means with a search the first one found may not be the one of interest because even the search would need to be case insensitive here.

 I think the best way would be to simply live is as is and implement code to read the first found and then next until no more is found using Case insensitive within the search not when building the index file.
The only true wisdom is knowing you know nothing

Centauri

  • New Member
  • *
  • Posts: 25
Re: CaseInsenstive
« Reply #5 on: April 07, 2020, 03:12:25 pm »
Thanks all for the replies.  Had a good look at other ways of achieving the result, and ended up setting the index of the table's Customer Name field to upper case and using the SearchKey() method using uppercase transformed search term - works a treat, and I should have done it that way from the start.

 

TinyPortal © 2005-2018