9 Replies Latest reply on Jun 9, 2011 6:04 PM by MstrPBK

    The Mystery of the Unresponsive Button ...

    MstrPBK

      Title

      The Mystery of the Unresponsive Button ...

      Post

      I have a self managing script which has so far has cranked out 1,800,000 records and climbing.  I runs in Browse Mode during process.  I have established a "Start Button" to restart work which works very well ... however I also have a "Stop Button" which is 'supposed' to stop the process mid-stream at an appropriate place in the script by means of a control variable (i.e.: Set variable $$x As 1, if $$x = 1 then stop).  This second button is not responding.

      Is this due to the FMAdv. 10 lock out during processing? ... or ... an error on my part that I may not be understanding about buttons and triggers?

      Peter Kelley
      St. Paul, MN USA

        • 1. Re: The Mystery of the Unresponsive Button ...
          philmodjunk

          As far as I know, you can't click another button while a script is running. (you can if it is paused, but that's not the case here.)

          You can abort the scritp by pressing the esc (Windows) or Command-Period (mac) as long as the script does not disable user aborts.

          You could also probably use Get ( ModifierKeys ) inside your script to check for whether a specific modifier key such as shift, ctrl, caps lock, etc. is down and use that to halt your script.

          • 2. Re: The Mystery of the Unresponsive Button ...
            MstrPBK

            PhilModJunk -

            This is what I have begun to suspect. (sigh)  The script is running slow as it is.

            As I am on a Macintosh ... the Command - Period keystroke can not cleanly work because it stops the script the moment it is struck on the keyboard.  At times this produces a unfinished record.  In turn it takes a few minutes to do the clean up from that type of abort.  I am hoping to find a means to do a clean abort during the run process.

            I have not used the Get(modifierkeys) function.  What is the philosophy behind that function and how might i impliment the logic on that in this situation?

            • 3. Re: The Mystery of the Unresponsive Button ...
              philmodjunk

              If you have a loop in your script, you can put it inside an If step to test to see if a specific modifier key is down. If it is, then your script can gracefully halt the script as you are now halting your script in a known spot in your code. This then is much like your original idea for testing a variable, but insided you're checking for a specific key being held down.

              • 4. Re: The Mystery of the Unresponsive Button ...
                MstrPBK

                FileMakerPro Aavanced 10 does not have the Get(modifierkeys) function but it does have the Get(AllowAbortState).  I am wondering if the later function might be implimented somehow to get a similar effect?  Anyone have any ideas?

                Addeneum: just noticed your rssponse above about the Get(ModifierKeys) function.  I would guess that would do the trick; I do have loops all over the place in the scripts (he he he he).  The Get(modifierKeys) fucntion seems to be new to FMA11 (sigh).

                Peter Kelley, St. Paul, MN USA

                • 5. Re: The Mystery of the Unresponsive Button ...
                  philmodjunk

                  Silly mistake on my part. The function is named: Get(ActiveModifierKeys)

                  • 6. Re: The Mystery of the Unresponsive Button ...
                    aammondd

                    I was testing  this

                    I held down the Shift Key till it looped enough

                    Set Variable [ $n; Value:1 ]
                    Loop
                    Set Variable [ $n1; Value:1 ]
                    If [ Get ( ActiveModifierKeys ) = 1 ]
                    Show Custom Dialog [ Title: "Stop"; Message: "You have successfully stopped the script"; Buttons: “OK”, “Cancel” ]
                    Exit Script [ ]
                    End If
                    Go to Layout [ “Visual Aids” (Visual Aids) ]
                    New Record/Request
                    Set Variable [ $n; Value:$n + 1 ]
                    Loop
                    Set Variable [ $n1; Value:$n1 + 1 ]
                    Exit Loop If [ $n1 > 1000000 ]
                    End Loop
                    Set Field [ Visual Aids::Helptext; "Endloop - " & $n ]
                    End Loop

                     

                     

                    • 7. Re: The Mystery of the Unresponsive Button ...
                      MstrPBK

                      YES YES the function Get(ActiveModifierKeys) does exist in FMAdv10!

                      ... and the Get(ActiveModifierKeys) = 2 is the shift (I think I remember quickly reading)

                      ... and in theory if an "IF" statemen were added to look for this conditon then

                      ... an controlled Abort could occur.

                      I think this ought to work!  If any one has any last comments now is the time say them - before I blow up my Mac Mini!
                      What an awsome thought.

                      Peter Kelley
                      St, Paul, MN USA

                      P.S. (blink) you mean FM now is in a Windows flavor?

                      • 8. Re: The Mystery of the Unresponsive Button ...
                        philmodjunk

                        Now in windows flavor?

                        FileMaker has been a dual platform application for many many years. One of it's main selling points is that you can move files from one system to the other and they (most always) will work with little or no modification.

                        • 9. Re: The Mystery of the Unresponsive Button ...
                          MstrPBK

                          I must have missed an annouchment along the way about FM being available in WIndows format.
                          (smirk) now I can have MORE fun!

                          And on that note the "The Mystery of the Unresponsive Button ..." has been solved and working well I might add.
                          Stay tuned for the next thrilling installment of Coder's Complex ...


                          Peter Kelley
                          St. Paul, MN USA