On Tue, 21 Apr 2009 15:46:20 -0700, "Matt Jarvis" <matt.jar...@kingrs.com> wrote:
>Being a) rusty and b) having a brain lapse... > >Is there a built in function that will tell me which item something is >when contained within a list? > >For example, I want to search for "C" in the list of "A", "B", "C", "D" >and want the returned value to be 3. Hi Matt! 1) create cursor my_list (my_data Char(1)) insert into my_list values ("A") insert into my_list values ("B") insert into my_list values ("C") insert into my_list values ("D") select my_list index on my_data tag "my_data" select my_list set order to tag "my_data" seek "C" ? recno() 2) local array my_list[4] my_list[1] = "A" my_list[2] = "B" my_list[3] = "C" my_list[4] = "D" ? ascan(my_list, "C") 3) ? at("C", "A" + "B" + "C" + "D") HTH -- Gianni _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/nojsu4di4u0phqurp0mbihmhhcfp4l9...@4ax.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.