Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Raymond Wong
  
 
 
 Raymond Wong
 Tags
Subject: RE: Help me with this code
Thread ID: 50691 Message ID: 50966 # Views: 1 # Ratings: 0
Version: Visual FoxPro 7 Category: Reports and Printers
Date: Tuesday, September 07, 2004 1:38:26 PM         
   


> > Hi Raymond
> >
> > > I wonder why INLIST doesn't behave as expected.
> > > I'm suspecting that INLIST is treating the whole list as only 1 item. So when it compares 153610 with '127473, 153610, 153610', they don't match.
> >
> > That is indeed correct. To use INLIST() you have to format the string so that it evaluates correctly. Thus this will work:
> >
> > lcStr = ['10'] + ',' + ['11'] + ',' + ['12']
> > ? INLIST( '11', &lcStr )
> > 

> > But this will not:
> >
> > lcStr = ['10,11,12']
> > ? INLIST( '11', &lcStr )
> > 

> > Regards
> > Andy Kramek
> > Microsoft MVP (Visual FoxPro)
> > Akron, OH, USA
>
> Hi Andy,
>
> Thanks for the clarification.
>
> I have 2 more questions:
> 1. Does the same limitation of 255 charaters for string apply to the list manipulated using INLIST?
> 2. Is there a function to count the number of items in the list?
>
> Regards,
> Raymond

lcStr = ['10'] + ',' + ['11'] + ',' + ['12']
?lcStr
?ALINES(laStr, lcStr,.T.,",")


Alines returns 3. The number of items in the string, delimited by ","
Word of caution here. If you have any separators in the numbers (like 1,000) the alines might give erroneous results. In such a case you might want to choose another item separator like ";" or "|"

Boudewijn LutgeĀ®ink
There are 10 types of people: Those that do understand binary calculations and those that do not.

ENTIRE THREAD

Help me with this code Posted by Raymond Wong @ 9/4/2004 6:08:49 PM
RE: Help me with this code Posted by Boudewijn Lutgerink @ 9/6/2004 6:55:23 AM
RE: Help me with this code Posted by Raymond Wong @ 9/6/2004 10:33:27 AM
RE: Help me with this code Posted by Andy Kramek @ 9/6/2004 12:55:32 PM
RE: Help me with this code Posted by Raymond Wong @ 9/7/2004 10:40:08 AM
RE: Help me with this code Posted by Juan Antonio Santana @ 9/7/2004 12:32:02 PM
RE: Help me with this code Posted by Andy Kramek @ 9/7/2004 1:18:35 PM
RE: Help me with this code Posted by Raymond Wong @ 9/7/2004 1:43:38 PM
RE: Help me with this code Posted by Boudewijn Lutgerink @ 9/7/2004 1:38:26 PM