Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 7 Monaten
Letzter Beitrag:
vor 7 Monaten
Beteiligte Autoren:
Art Bonds, Fabrice Harari, iso, Yogi Yang

[WD20] - How to make HReadSeekFirst case insensitive and exact match?

Startbeitrag von Yogi Yang am 11.01.2018 07:20

Hello,

I have been using HReadSeekFirst without giving it any thought. And it has worked properly satisfying my requirements. But today I ran into two problems which I cannot solve:

1. How to make HReadSeekFirst case insensitive and exact-match?
2. How to seek on multiple fields when the fields being searched do not have corresponding composite key defined in Analysis?

TIA

Antworten:

Hi Yogi,

You can change the key within the data file, to case sensitive

von iso - am 11.01.2018 11:19
Hi


Hreadseekfirst just uses the keys as they are defined, therefore:

1. How to make HReadSeekFirst case insensitive and exact-match?

You don't.. You change the settings of the key in the analysis (or add another key with different settings)

2. How to seek on multiple fields when the fields being searched do not have corresponding composite key defined in Analysis?

Yo don't. You create a new composite key -OR- you use a query and accept the fact that because you DIDN'T create the appropriate key, it will be slow.

Best regards

von Fabrice Harari - am 11.01.2018 15:32
Hi Yogi,

2. How to seek on multiple fields when the fields being searched do not have corresponding composite key defined in Analysis?

Off the top of my head (and some this may not work as expected...QA is your friend):

a) I have never used it so not clear on it's capabilities, but would HBuildKeyValue be of any use?

b) Could you use HFilter?

c) Use a query? Something like...
select somefield1, somefield2 from somefile
where field1 = yourvalue1 and
where field2 >= yourvalue2 and
where field3 IN (yourlist)
Will probably have to use StringBuild to build the sql statement.

d) Last resort, full table scan using programming... hReadFirst physical record number 1 and check the fields in the record against variables containing your search values. If found add it to your view, if not hReadNext on to the next record until hOut. If you do that I would use the function that disregards case and punctuation when comparing the search value against the value in the file. Should not be too bad if the file is small and especially not to bad if the disk is a SSD.

von Art Bonds - am 11.01.2018 15:58
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.