August 28, 200322 yr Since I have now taken a intro programming course I want to start using some of what I learned with Filemaker. I want to perform a script that will determine if the production status is unknown then omit that record or records. Here is what I have written. Enter Find Mode[] Go to Field["Prod Status"] Perform Find [Restore] If ["ProdStatus" = "unknown"] omit record End If My problem is that it will only omit one record at a time. So I am thinking I need to do a loop of some kind. Where it would go through each record to see if the if statement is true. How would I do a while loop in Filemaker? Paul
August 28, 200322 yr This is confusing to Filemaker people. Usually, you wouldn't need to do this at all. Your original find should have the ommission criteria built into it. Enter find mode manually, type the criteria you need into your ProdStatus field, then make a new find request, type "unknown" into ProdStatus and click the "omit" box. The find will display the found set minus the unknowns in one fell swoop. No need to get a script involved at all. You can set up pretty complex finds this way, with dozens of separate request. If you decide that you will need to do this frequently, run the find manually, then make a script with a single Perform Find command ("restore" option checked). When you click OK, you'll get a keep/replace prompt. Click Replace and your new one-line script will memorize the manual find you just made, however complex. Then it can be run again at the click of a button. You can also call upon this find in other scripts by running this new one-line script as a subscript. You can do loops in FM's scripting, but as you've described the situation, I see no need for one. Steve Brown
August 31, 200322 yr Hi Paul and Steve, If really this search is designed to be a frequent search, you'd better look for relationships here, then perform a GoToRelated records using a boolean calculation at right side Case(status="unknown",0,1) and a constant field which you will populate with 1.
August 31, 200322 yr pkudrle said: How would I do a while loop in Filemaker? Paul BLAST! Where is the code? It disappeared after my first attempt! Here is it again: Loop Set Field [ g_Temp_numb, g_Temp_numb +1 ] Enter Find Mode Set Field [ ID_Order, g_Temp_numb ] Perform Find Exit Loop If [ Status( CurrentFoundCount) = 0 ] End Loop Or you can use Goto Next Record with Exit if last before End Loop HTH
Create an account or sign in to comment