3 Replies Latest reply on Nov 13, 2009 8:05 PM by jjbong

    Buttons and Scripts: Question about a particular option

    ralvy

      Title

      Buttons and Scripts: Question about a particular option

      Post

      When I assign a script to a button, I always notice the Current Script dropdown menu (in the Button dialog) that presents me with four options:

       

      Pause

      Halt

      Exit

      Resume

       

      where Pause is the default. I never mess with this option because I don't know what it's asking. I can't find anything about it in the Help docs. What is this option?

        • 1. Re: Buttons and Scripts: Question about a particular option
          philmodjunk
            

          ralvy wrote:

          I never mess with this option because I don't know what it's asking. I can't find anything about it in the Help docs. What is this option?


          That's a wise choice. In most cases, the default works fine. There are cases when one of the other options does nice things for your interface.

           

          The other options control what happens when a user clicks a button while the a script has been paused.

           

          Consider:

           

          I have a layout that displays invoices that have been completed by other users over the network. A cashier brings up this layout and selects invoices to print and process the monetary transaction. The cashiers leave this screen up all day, checking it for any new invoices to appear. To automatically bring up new invoices, I've designed the layout with an infinite loop:

           

          Loop

            Perform find [restore]

            Pause/Resume Script [Duration(seconds):  Time(0,0,2)]

          end loop

           

          The loop updates the list of waiting invoices every two seconds. There's more to the actual script, but that should give you the idea.

           

          For all the buttons on this layout, I've selected the "Halt" option.

           

          If I kept the standard default setting for these buttons, they would take the user to a new layout, but would then leave the user with the above paused script to deal with.

           

          So I wouldn't change this setting for a scripted button, unless I have a paused script to deal with.

           

          Here's the details as I understand them.

           

          Pause:  Paused script remains paused.

          Resume: Paused script will be resumed (after the button's script executes, I think.)

          Exit: Current paused script is exited (just like Exit Script[]) if the current script was called by another script, control returns to the original script.

          Halt: Execution of all scripts (except the button's script) are halted. This is just like the Halt script step.

           

          Hope that makes sense for you.


          • 2. Re: Buttons and Scripts: Question about a particular option
            ralvy
               Very nicely explained. Thanks. Certainly didn't find anything like this in the Help docs.
            • 3. Re: Buttons and Scripts: Question about a particular option
              jjbong
                

              I can expand on this slightly.

               

              I have an application with people and organizations. I have a button to add an organization to a person, which runs a script.

              The script displays a layout in a new window with a portal that allow the user to select an organization to assign to this

              person. It has a Done and Cancel button. When the script displays this window, it does a Pause Indefinitely, waiting for

              the user's response.

               

              Done and Cancel both run a script to set a (global) variable to indicate which was selected,  and this is set to Resume,

              meaning after the script specified by the button control, it will resume the paused script (which had been waiting

              indefinitely).