Dialog Box

Dialog Box

am 24.01.2008 22:13:38 von John Devlon

Hi,

I've created a small script and attached it to a button.

I would like to modify the script, so when it's executed, a dialog appeirs,
confirming I'm sure the script will be executed... Something simple, with a
cancel and ok button...

Does anyone know how?

Thanx

John

Re: Dialog Box

am 24.01.2008 23:00:50 von glenn.schwandt

On Jan 24, 3:13 pm, "john Devlon" wrote:
> Hi,
>
> I've created a small script and attached it to a button.
>
> I would like to modify the script, so when it's executed, a dialog appeirs,
> confirming I'm sure the script will be executed... Something simple, with a
> cancel and ok button...
>
> Does anyone know how?
>
> Thanx
>
> John


Look up "Show Message" in the help file.

You should also include the Filemaker version and Operating System you
are using when submitting questions. Sometimes the answer will vary
depending upon those variables.

Re: Dialog Box

am 25.01.2008 04:05:59 von Helpful Harry

In article <6c7mj.44459$y84.4010110@phobos.telenet-ops.be>, "john
Devlon" wrote:

> Hi,
>
> I've created a small script and attached it to a button.
>
> I would like to modify the script, so when it's executed, a dialog appeirs,
> confirming I'm sure the script will be executed... Something simple, with a
> cancel and ok button...
>
> Does anyone know how?

The Show Message command is what you want, but you also have to use the
Get(CurrentMessageChoice) function to determine which dialog window
button the user clicked - this function returns the number of the
button that the user clicked on.

The basic Script would be something like:

Show Message ["Are you sure you want to do that?", "Cancel", "OK"]
If [Get(CurrentMessageChoice) = 1]
# Button1 has been clicked - 'Cancel'
Exit Script
Else
# Button2 has been clicked - 'OK'
# Perform rest of normal script
End If

You can of course have more than just the two buttons that this
psuedo-script handles.

NOTE: The first button defined for the Show Message command is always
the default one (the one that can be 'clicked' by pressing the Return /
Enter key on the keyboard), so you need to be careful what order you
put the buttons. For example, do not put "Yes" and the first button in
a "Do you want to delete this record?", otherwise the record will be
deleted whenever the user accidently presses the Enter key - in this
case the default button should be "No" so that the user is forced to
click on the "Yes" to have the record deleted.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)

Re: Dialog Box

am 25.01.2008 11:20:10 von ursus.kirk

Just to make sure. In the newer versions the script-step is called 'Show
Custom Dialog'. And it has a few more functions then just showing a dialog.

Keep well, Ursus

"Helpful Harry" schreef in bericht
news:250120081605590598%helpful_harry@nom.de.plume.com...
> In article <6c7mj.44459$y84.4010110@phobos.telenet-ops.be>, "john
> Devlon" wrote:
>
>> Hi,
>>
>> I've created a small script and attached it to a button.
>>
>> I would like to modify the script, so when it's executed, a dialog
>> appeirs,
>> confirming I'm sure the script will be executed... Something simple, with
>> a
>> cancel and ok button...
>>
>> Does anyone know how?
>
> The Show Message command is what you want, but you also have to use the
> Get(CurrentMessageChoice) function to determine which dialog window
> button the user clicked - this function returns the number of the
> button that the user clicked on.
>
> The basic Script would be something like:
>
> Show Message ["Are you sure you want to do that?", "Cancel", "OK"]
> If [Get(CurrentMessageChoice) = 1]
> # Button1 has been clicked - 'Cancel'
> Exit Script
> Else
> # Button2 has been clicked - 'OK'
> # Perform rest of normal script
> End If
>
> You can of course have more than just the two buttons that this
> psuedo-script handles.
>
> NOTE: The first button defined for the Show Message command is always
> the default one (the one that can be 'clicked' by pressing the Return /
> Enter key on the keyboard), so you need to be careful what order you
> put the buttons. For example, do not put "Yes" and the first button in
> a "Do you want to delete this record?", otherwise the record will be
> deleted whenever the user accidently presses the Enter key - in this
> case the default button should be "No" so that the user is forced to
> click on the "Yes" to have the record deleted.
>
>
> Helpful Harry
> Hopefully helping harassed humans happily handle handiwork hardships ;o)

Re: Dialog Box

am 27.01.2008 14:53:16 von John Devlon

Thanx for all the feedback...

It works great

john