June 1, 200520 yr (background) As a user I might like to search for "apples" or "oranges". I want the Found Set to contain records of apples, and as well records of oranges. Being a reasonably able user, I find apples, then extent the found set. But, I could perform an OR search. To do this, first Enter find mode, then put "apples" in the field. Next, create a new record, and put "oranges" in the field. Then run the find. So far so good? Okay, here's the question: I've a table, fruit, with fruit::names like "apples", "oranges", "grapes". Fruits come and go in the fruit table. On some other layout I want to built an OR search, based on every record in fruits. I want to do this in a script, but I can't bounce between fruits and the other layout -- because I need fruits to stay in browse mode and the other layout to stay in find mode. How do I script this?
June 1, 200520 yr Create a value list called Fruit, based on all names in the fruit table. Then script your find in the other table as follows: Allow User Abort [Off] Set Error Capture [On] Go to Layout [based on secondary table] Enter Find Mode [] Loop Set Field [2ndTable::fruitname; Substitute( MiddleValues( ValueListItems( Get(FileName); "Fruit" ); Get(RequestCount); 1 );
June 1, 200520 yr Author Wow man, that's gorgeous. I can understand it at a glance! thank you Value Lists, ...I'd not have guessed.
June 21, 200520 yr Author Queue, this post helped me tremendously. I posted a sample file that performs a search of user defined terms across every tree in a relationships graph, available here: http://www.fmforums.com/threads/showthre...;vc=#Post164412 Which is the fruits of that effort. Thank you.
Create an account or sign in to comment