Dialog Box

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
John Devlon [ Do, 24 Januar 2008 22:13 ] [ ID #1915336 ]

Re: Dialog Box

On Jan 24, 3:13 pm, "john Devlon" <johndev... [at] hotmail.com> 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.
glenn.schwandt [ Do, 24 Januar 2008 23:00 ] [ ID #1915337 ]

Re: Dialog Box

In article <6c7mj.44459$y84.4010110 [at] phobos.telenet-ops.be>, "john
Devlon" <johndevlon [at] hotmail.com> 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)
Helpful Harry [ Fr, 25 Januar 2008 04:05 ] [ ID #1916167 ]

Re: Dialog Box

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" <helpful_harry [at] nom.de.plume.com> schreef in bericht
news:250120081605590598%helpful_harry [at] nom.de.plume.com...
> In article <6c7mj.44459$y84.4010110 [at] phobos.telenet-ops.be>, "john
> Devlon" <johndevlon [at] hotmail.com> 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)
ursus.kirk [ Fr, 25 Januar 2008 11:20 ] [ ID #1916171 ]

Re: Dialog Box

Thanx for all the feedback...

It works great

john
John Devlon [ So, 27 Januar 2008 14:53 ] [ ID #1917227 ]
Datenbanken » comp.databases.filemaker » Dialog Box

Vorheriges Thema: How to allow "@" in text field?
Nächstes Thema: How to copy the 'image' of a layout into a container field ?