Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need function that checks if chars exist in string ($,in
Message
From
16/04/2002 11:39:05
 
 
To
15/04/2002 18:53:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00645231
Message ID:
00645519
Views:
12
As others have stated, there is not built in function to do what you want. You'll need an OR in your comparison.


>?OCCURS('TH',myString) is OK,
>but what if I need to check whether 'TH' or 'BR' is in myString?
>
>
>>Have you looked at OCCURS()? It will return a numeric rather than a logical.
>>
>>>myString='OP101,TH310,XB171'
>>>myDept='TH,BR'
>>>Is there a function that returns .T. if either "TH" or "BR" is in myString?
>>>
>>>?INLIST(myString,'TH,BR') returns .F.
>>>?INLIST(myString,'TH','BR') returns .F.
>>>?'TH,BR' $ myString returns .F.
>>>
>>>myString is a string, listing (dept code + product code)s, separated by commas. The first 2 chars is Dept code, followed by the product code (example: OP is the dept code, 101 is the product code, etc.)
>>>myDept is a string, listing department codes (separated by commas).
>>>What I'm looking for is a function that will return .T. if any one of the department codes listed in myDept is in myString.
>>>
>>>Is there such a thing?
>>>Thanks all!
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform