FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
[WD20] - How to make HReadSeekFirst case insensitive and exact match?
[WD20] - How to make HReadSeekFirst case insensitive and exact match?
Débuté par Yogi Yang, 11 jan. 2018 08:20 - 3 réponses
Connectez-vous…
Yogi Yang
#1
Posté le 11 janvier 2018 - 08: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
Signaler
0
0
iso
#2
Posté le 11 janvier 2018 - 12:19
Hi Yogi,
You can change the key within the data file, to case sensitive
Signaler
0
0
Fabrice Harari
#3
Posté le 11 janvier 2018 - 16:32
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
Signaler
0
0
Art Bonds
#4
Posté le 11 janvier 2018 - 16:58
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.
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte