No, the 24-item limit remains in place. You might be thinking of the way the IN operator in a SQL WHERE statement has changed. In earlier versions, IN mapped to INLIST(), which effectively limited it to 24 items. That mapping was removed in 9.0, which means you can list more items with IN, but it is no longer Rushmore-optimised.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
You could always roll-your-own using the $, or Occurs(), or ATC(), etc. Simply providing a comma delimited (or otherwise delimited) string of the words or phrases you are attempting to rule in or out. Obviously with data such as numeric, date, datetime, etc. you would need to use TRANSFORM() in order to get a string comparison. Another way around this is to use multiple INLIST() calls, such as INLIST(myvar, 0, 1, 2,...23) OR INLIST(myvar, 24, 25, 26...). In any event it is a silly limit, but not one that is impossible to work around.
Just to follow up my point about the IN operator not being Rushmore-optimised ....
It seems that this works slightly differently in 9.0, in that, as soon as it finds the first matching term, it stops searching. Earlier versions would carry on to the end of the list. So you can speed up queries slightly by putting the most common terms early in the IN list.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Thanks, interesting article (even though the best way to read it would be to print it out landscape-oriented on legal-size paper using color printer). A star from me.
At least the first 3 or 4 charts were more or less predictable. I always thought that TANSTAAFL were not much of an accepted scientific principle and couldn't be taken as an axiom. ;-)
(I rubbed my eyes in disbelief and re-read several times that part: The quick answer follows from the TANSTAAFL principle (see AcroNyms). Since AT and ASCAN give you more information, namely the position of the matching candidate, they will take longer. Thus, $ wins. Q.E.D. I felt relieved when I realized that this catchy introduction shouldn't be taken seriously.)
Another way to handle this sort of problem generally is to parse the list of items and then do the search. You could use ALINES() to create an array and then use ASCAN() to search.
But VFP being a database application, the best is probably to put the items into a cursor and search that.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.