Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Letters should be found in a string - what is the best?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Letters should be found in a string - what is the best?
Miscellaneous
Thread ID:
00428574
Message ID:
00428574
Views:
76
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
Next
Reply
Map
View

Click here to load this message in the networking platform