In article <031120051820190918%helpful_harry (AT) nom (DOT) de.plume.com>,
helpful_harry (AT) nom (DOT) de.plume.com says...
Quote:
In article <MPG.1dd2f7ff51336e3f989d9e (AT) shawnews (DOT) vf.shawcable.net>, 42
nospam (AT) nospam (DOT) com> wrote:
Is there any way of preventing the Enter key to resume a paused script.
I'd like the user to have to push a button on the layout.
If not, I guess I'll have to nominate a 'default' button, but was hoping
that it could be avoided.
Don't pause the script at all.
You cansplit the script into two scripts and have the button run the
second script. ) |
Yep. But there are some caveats to that...
The most significant of which is that the user can just close or switch
windows in the middle of the process -- and go do something else.
When its a paused script the active window becomes modal, and the user
cannot simply close it or switch to a different window (assuming allow
user abort is false), and that's a behaviour I'm looking to preseve.
The trouble with it is that enter just resumes the script. (The buttons
in this case all run a tiny script called 'continue script' with the
name of the button as the script parameter. The continue script sets a
global varaible $$parameter = Get(Script Parameter), and is set to
resume.
So the main script is:
do some stuff...
pause/resume
if $$parameter = "Accept" ...
elseif $$paramter = "Reject" ...
elseif $$ ...
But if the user just presses the enter key, none of the buttons are
invoked and so the $$parameter doesn't get set.
One workaround would be to preset $$parameter in advance of the pause,
effectively nominating a default button, which I mentioned previously.
Fortunately I realized another option, that does what I want, would be
to simply trap the "null" parameter in a loop...
e.g.
$$paramter = ""
loop
pause/resume
exit loop if $$paramter != ""
end loop
....
The enter command still resumes the script, but nothing effectively
happens until the user pushes a button.
But thanks for your suggestion, I've used the method you suggested in
many situations - I even prefer it tieing a user to a strict sequential
process. But sometimes a strict sequence is what is required.
I'm still getting used to FM7 and 8, and I'm still discovering all the
new features they've added... so while it doesn't suprise me that they
haven't added a "checkbox" somewhere to accomplish what i wanted... it
would't have surprised me if they had; and I would hate to write extra
code to re-invent a feature they've added.
-regards,
Dave