![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a script that goes to a 'find person' layout and enters find mode[pause], pausing for data entry. I need two buttons on the layout, Next and Cancel. Is there a way to have the buttons resume the script and signal which was pressed? I tried creating a small script called 'Cancel Button Pressed,' which I wanted to do the following: 1. Set a field called Globals::g_button = "Cancel" 2. Resume the script ...but there doesn't appear to be a way to resume a script from within a script. |
#3
| |||
| |||
|
|
audleman (AT) quasika (DOT) net <audleman (AT) quasika (DOT) net> wrote: I have a script that goes to a 'find person' layout and enters find mode[pause], pausing for data entry. I need two buttons on the layout, Next and Cancel. Is there a way to have the buttons resume the script and signal which was pressed? I tried creating a small script called 'Cancel Button Pressed,' which I wanted to do the following: 1. Set a field called Globals::g_button = "Cancel" 2. Resume the script ...but there doesn't appear to be a way to resume a script from within a script. Not in versions previous to FM7. There, you have to write a separate script for each button. :/ However, you can modularize and put the working "guts" into a second script, called from each of the first ones. Now, in FM7, there are "script parameters" which can be attached to each button in the script assignment dialog. So you can attach "Cancel" to the cancel button, etc, and then test in the script for Get(ScriptParameter) and branch accordingly. Script parameters can be hard coded, based on calculations, and even multi-valued, so they can be parsed out later in the script. They persist only for the running of the current the script. So if you have 26 buttons, A-Z, you write one script, attach it to all of them, but put the correct letter in as the script parameter. Muuuuch better. Still not perfect, but much better. |
![]() |
| Thread Tools | |
| Display Modes | |
| |