13 Replies Latest reply on Dec 28, 2009 11:22 PM by TuxfordC

    Find and Omit in FM Pro 9

    TuxfordC

      Title

      Find and Omit in FM Pro 9

      Post

      This is more of an observation than a question,  comment from an expert would be welcomed.

       

      In writing  scripts to select specific groups of records from a list, the Find and Omit operations

      worked properly for me - until I changed one of them so that Omit came before a Find

      instruction in the set-up box.

       

           After this change, the  Omit worked properly but the following Find failed. I tried this on another

      script, exactly the same result. In a script where a found set needs to be refined by omitting different

      criteria, unless 'Find' is stated before  'Omit', the selection process does not do as instructed.

       

      Changed them back to put the Find first, everything behaved properly.

       

          I could not see any reference to this in the Help notes, is there a comment that I have missed?

       

      Happy New Year,

       

      TuxfordC

        • 1. Re: Find and Omit in FM Pro 9
          bcooney
            

          You can perform an omit before a find, and still end up with a found set.

           

          However, after the first omit, do you have any found records? 

          • 2. Re: Find and Omit in FM Pro 9
            TuxfordC
              

               Yes, the first Omit worked properly giving me a set of all the other records (those without the

                field data that triggererd omit).  I then did a Find but it did not work, the set remained as it was

               after the Omit.

             

            TuxfordC.

            • 3. Re: Find and Omit in FM Pro 9
              mrvodka
                 Please post your script. It seems as though you are trying to do a contrain after find a found set.
              • 4. Re: Find and Omit in FM Pro 9
                TuxfordC
                  

                Here's the relevant part of the script:

                 

                 Perform Find(Restore)

                 Sort Records(Restore; No Dialog)      (This sort is a simple Last Name/First Name alpha sort)

                 Go to Layout......... Print Setup..... etc.

                 

                 My question relates to the Perform Find.

                 

                 If I State the requests like this in the Specify Find Request dialog box:

                         

                        Action                    Criteria

                        Find Records           M13_Main_Contacts::contact_parish_roll: (="Casual")

                        Omit Records          M13_Main_Contacts::Archived: (="A")

                 

                  it works correctly and the following Sort gives an alphabetical list of all those on the roll who are listed as

                  Casual contacts and are not Archived.

                 

                 If I specify exactly the same requests but with the Omit {archived}  performed before the Find {casual}, the

                  Find request does nothing and I get a much bigger list. 

                 

                Thanks,

                TuxfordC

                • 6. Re: Find and Omit in FM Pro 9
                  bcooney
                    

                  Using Omit Archived, Find Casual will return everything but the non-casual, archived records. It will return all Casual, whether archived or not.

                  • 7. Re: Find and Omit in FM Pro 9
                    TuxfordC
                      

                     Thanks for two recent comments, I have previously read through the help and can not find what I am

                    doing incorrectly

                     

                    BCooney  wrote :  "Using Omit Archived, Find Casual will return everything but the non-casual, archived records.

                    It will return all Casual, whether archived or not."

                     

                    But it does not. Using Omit Archived, Find Casual is returning everthing that was not archived. There are four

                    options in the Value List for Parish Roll : Electoral, Pastoral, Casual and Unclassified. All are being returned

                    unless the Find is performed before the Omit.

                     

                    I'm not hassled by this but expected that these actions could be completed in either order.

                     

                    TuxfordC

                    • 8. Re: Find and Omit in FM Pro 9
                      comment_1
                        

                      TuxfordC wrote:

                      Using Omit Archived, Find Casual is returning everthing that was not archived.


                      Not exactly: it finds not archived or casual. If you reverse the order, it will find casual and not archived.


                      • 9. Re: Find and Omit in FM Pro 9
                        TuxfordC
                          

                        You wrote " Not exactly: it finds not archived or casual. If you reverse the order, it will find casual and not archived."

                         

                        I don't see it that way. The Note in the edit Find Requests dialog Box reads " Find requests are executed in the order

                        that they appear."

                         

                        There two separate requests operating on different fields of the same data table.  The Find requests FM to find all records

                        marked casual.  Once this is done the Omit goes through the Found set and leaves all all those marked archived.

                         The resulting set is : casual and not archived.

                         

                        Reverse the order of the requests and doing the Omit first gives us :  not archived and casual.  I don't see where an

                        OR comes into it - or is my Boolean out of date?

                         

                        TuxfordC

                         

                        • 10. Re: Find and Omit in FM Pro 9
                          comment_1
                            

                          I am not sure whether we are debating the facts or their meaning. The fact is that an Omit request is AND'ed to the preceding requests, while a Find request is OR'ed. In other words, an Omit requests says "but not …", while a Find request says "and also …".

                           

                          Therefore, the order of the requests is important when there is one or more requests to omit.

                          • 11. Re: Find and Omit in FM Pro 9
                            TuxfordC
                              

                            You said "Therefore, the order of the requests is important when there is one or more requests to omit."

                             

                              Based on what is happening, I agree with that completely. My interpretation of the Note at the top

                            of the Find Edit Box was that each instruction would be actioned separately, in the order they were listed. 

                            In that case it should not matter what the order was, while in fact the order is important because of the

                            way that FM does the job.  

                             

                            One could consider sorting a box of mixed fruit - apples and oranges.  If we removed (omitted) all

                            the oranges and then selected (found) all the apples that weighed over 5 ounces, this would give exactly

                            the same result as first selecting all the mixed fruit that each weighed over five ounces and then removing

                            the oranges from that selection. The order does not matter.

                             

                            Many thanks for your comments, perhaps we should let the matter rest?

                            TuxfordC

                            • 12. Re: Find and Omit in FM Pro 9
                              comment_1
                                 I agree that the help could be more clear on this - but Filemaker, in their attempt to keep up the "Mom's and Pop's database" appearances, would rather be ambiguous than technical.

                              One more note: it may be convenient to imagine requests being processed as a series of finds, but that is not what really happens (at least I hope it isn't). There is only one find, with all requests compounded into a single predicate.
                              • 13. Re: Find and Omit in FM Pro 9
                                TuxfordC
                                  

                                 Thanks again for your comments and assistance. I find the  FM Help rather disappointing and am

                                consequently writinga set of UserHelp notes for this particular database. 

                                 

                                I inherited the development/maintenance of this by opening mymouth at the wrong time, and I

                                will admit to being somewhat disappointed with FM. After 25 plus yearsof programming in the

                                various versions of PASCAL, I find myself missing the loop statementsWhile...Do,  Repeat...Until,

                                and For....

                                 

                                FM appears to be quite restricted in its ability to manipulate data, with result that Scripts become

                                unduly complicated.  Still, I guess that most users must be happy, else they would not be using FM.

                                 

                                TuxfordC