Question : In Function for Fox Pro

In Access you can use a Function called In or Not In to filter the fields in the WHERE statement.
For example Field In(1,2,3) if the Field equals a 1 or 2 or 3 then it will pull the data.

What is the In function called in Fox Pro 9.0.  I need to pull, ceritan informationfrom some fields without having a bunch of OR statements, plus I'm not sure I can mix and match AND and OR statements in the WHERE section?

Thanks,
Mark

Answer : In Function for Fox Pro

There are a couple of ways to do this

For character strings:
  * --- Is It In The Search String ---
  cThisMonth = "July"
  INLIST(cThisMonth,'July','August','September')
        or
  * --- Is It In The Search String ---
  cThisString = 'ABC'
  cThisString $  "UYTUYTOILHKGUABCLKLJKJK")
        or
   * --- Find How Often It Occurs In The Search String ---
  cThisString = 'ABC'
  OCCURS(cThisString,  "UYTUYTOILHKGUABCLKLJKJK")
        or
   * --- Find Where It Occurs In The Search String ---
   cThisString = 'ABC'
  AT(cThisString,   "UYTUYTOILHKGUABCLKLJKJK")

For numbers
  * --- Is It In The Search Number List ---
  nThisNumber = 12
 INLIST(nThisNumber,1,2,3,4,5,6,7,10,11,12,13,14)

You should look into your VFP Help files for further explanation of each function / operator.

Good Luck

Random Solutions  
 
programming4us programming4us