Posted by on May 5, 2014

To increase the readability of your scripts, assign button values to script variables when using Show Custom Dialog. I usually use the dialog’s message calculation for this, but the title works just as well, or now that FileMaker 13 allows the use of calculations for button text, you could place the calculations there.

show custom dialog

With such variables in place, your testing code can reference the button names instead of those impersonal numbers.

If[Get( LastMessageChoice ) = $ok_button]
  # Do OK stuff.
Else If[Get( LastMessageChoice ) = $cancel_button]
  # Do Cancel stuff.
End If

Posted in: Articles

Comments

Be the first to comment.

Leave a Reply


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*