6 Replies Latest reply on Apr 4, 2012 7:42 AM by Dennis_Carr

    Corruption or a Filemaker bug on stacked scripts?

    Dennis_Carr

      Help Please.

       

      I have a series of windows and scripts stacked atop the other with each level being held at the end of the script by the Loop / Pause/Resume Script {Indefinitely] / End Loop routine. Each level is maintained by Exit script on each button running the window so the same script is being run over and over until a "Done" is clicked, closing the window/script and reverting to the next lower paused script in the stack. The stack is six scripts high. I'm moving to the top stack without doing any additonal processing at each script level except to get to the next stack up. The top window/stack is a series of records with no portals.

       

      Problem: when l click on a check box (which runs a script), the first two clicks (each on a different/any record) processes normally. Everytime!! on the third click, four of the scripts disappear out of the stack and I'm left at the control loop (Loop / Pause/Resume Script {Indefinitely] / End Loop) of the second from bottom stack. All my prior opened windows are still open and layered as opened. Clicking on the "Done" button on the window at the script I'm left at reverts down the stack normally.

       

      Filemaker 11 Advanced on a new iMac with Lion. Tested on another iMac, same problem, but on FMA 10. Couldn't find anything in Deleveloper Forum history.

       

      Thanks.

       

      Dennis Carr

      AdTool, Inc.

        • 1. Re: Corruption or a Filemaker bug on stacked scripts?
          Vaughan

          The button on the third window might not be doing what you think it is.

           

          Other than that, why the stacked-windows thing? That hasn't been necessary cince FMP 6 days.

          • 2. Re: Corruption or a Filemaker bug on stacked scripts?
            Malcolm

            Problem: when l click on a check box (which runs a script), the first two clicks (each on a different/any record) processes normally. Everytime!! on the third click, four of the scripts disappear out of the stack and I'm left at the control loop (Loop / Pause/Resume Script {Indefinitely] / End Loop) of the second from bottom stack.

             

            If it happens every time you can be sure that you've programmed it that way.

             

            It may not be code that is in the flow that you are testing. Script triggers may invoke other scripts so look for them. Remember to look at your file preferences for scripts to be called when the file is closed too.

             

            Malcolm

            • 3. Re: Corruption or a Filemaker bug on stacked scripts?
              BruceHerbach

              From what you describe,  I don't believe that there is a FileMaker bug or corruption.  Most likely there is another script being run through a script trigger or the wrong branch in an if statement due to a logic error.  In short a bug in one of the scripts.    Probably the easiest way to track this down would be to use the debugger and data viewer.  This will show you exactly what is happening.   I would recommend opening all of the windows as you describe,   start the debugger. Then click the check box and see what is going on.

               

              HTH

              Bruce

               

              Message was edited by: Bruce Herbach

              • 4. Re: Corruption or a Filemaker bug on stacked scripts?
                Dennis_Carr

                Guys, thanks for the response.

                 

                I think I have a real Filemaker bug here.

                 

                Bruce, I am using the debugger. I've been programming in Filemaker since 5.5. There are no script triggers in any of these windows (this is a definition routine where the next window up adds data for the prior window to use, which is why the stack. I normally only go one window up.) This all new code. Three scripts just disappear in the debugger leaving me at the bottom of the last pause script. The script that triggers the problem after the third running is simple - sets and unsets four flags using one and blanks, four lines of code.

                 

                I have a new clue however. If I start the stack load one script up from my normal starting script, the bug goes away. All scripts from that one step up are in the same file. The originating script that starts the stack is generated from another, old code file. I'm going to get around this by rewriting how the new file is accessed from the old file and see if that helps.

                 

                Thanks again.

                 

                Dennis Carr

                AdTool, Inc.

                • 5. Re: Corruption or a Filemaker bug on stacked scripts?
                  BruceHerbach

                  Dennis,

                   

                  You do introduce a new wrinkle here,  multiple files.  When the scripts disapear,  is it the script in the old/originating file that is still running?

                   

                  I have had similar things happen when working with a multifile set up and inadvertantly close the last window in one of the files I am working on.  All of a sudden all of the open scripts are gone. 

                   

                  One thing I have started doing is have the open window or GTRR new window steps name the windows and then close the windows by name.  This adds more control to the system and avoids a script closing the wrong window because I changed focus.

                   

                  I have to say I have never tried to stack windows using multiple instances of scripts and pause statements.  I do use the pause set up to keep a specific window on top.

                   

                  As far as corruption in the file goes,  it might be a possibility.  Can you take a copy of the file and run it through the recover process and see what the log file says? 

                   

                  HTH

                  Bruce

                  • 6. Re: Corruption or a Filemaker bug on stacked scripts?
                    Dennis_Carr

                    Bruce,

                     

                    When the scripts disappear, what is left in the stack is the originating script from the old file at the bottom

                    of the stack and the first script in the new file which has the control loop. By the way, the new file is strictly

                    an entry file with no fields defined (separation model).

                     

                    I just rewrote the routine so the first calling script from the old file is halted before starting the new stack.

                    Everything is working now but is a mystery. Over the next couple of months the old file is getting re-

                    written into the new file. This is a vey large system being completely re-written in stages from FMP 6.0, a

                    many year process.

                     

                    Sounds like good advice on closing windows by name. I'll give it a try, along with running both files through

                    the recover process.

                     

                    Thanks.

                     

                    Dennis Carr

                    ToolMaker

                    AdTool, Inc.

                    dennis.c@adtoolinfo.com