Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Letters should be found in a string - what is the best?
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Letters should be found in a string - what is the best?
Divers
Thread ID:
00428574
Message ID:
00428574
Vues:
74
Hi everyone,

In my main table I have 10 character Amenity field. This field could be empty or could be like:
AB
CD
A8BC
BCDFJ
where each letter is a coded value.
In Amenities Lookup table I have each code and its description, like, for instance:
(don't show the actual codes)
A - Air Conditioned
etc.

User selects one or multiple codes from multilist:
This is the code, I use for creating where expression:
* return criterion for field value
	lnLen=alen(.btcSelArray, 1)
	for li = 1 to lnLen	&& cycle over rows in the array of selected items
		m.crit=m.crit+ iif(li=1,iif(.ExcludeFlag, '! ', ''),iif(.ExcludeFlag, ' AND ! ', ' OR '))+;
			'"'+.btcSelArray[li]+'" $ '+mapto
	endfor
My question is: do you think it's the best solution or there is another better solution?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform