The alertmodal statement displays a modal alert sheet (not attached to any window) with a message and one or more buttons.
This statement has three parameters:
text – is the message to display in the alert.
option – The name of an option that modifies the operation of this statement. See below for descriptions of each option. The option can be specified in either upper or lower case.
value – The new value for this option.
The alertmodal statement displays a modal alert sheet (not attached to any window) with a message and one or more buttons. In its simplest form, it displays the message with one button, Ok.
alertmodal "The operation is complete"
The appearance and operation of the alert can be modified by adding one or more pairs of option/value parameters to the alertmodal statement, like this:
Each of the available options is described below.
Use this option to define one or more custom buttons. The option value should be a comma separated list of buttons to include in the alert. The buttons must be listed in reverse order – the first button listed will be on the right and will be the default button if the Enter or Return key is pressed. This example displays an alert with three buttons.
alertmodal "Do you want to continue?","Buttons","Yes,No,Maybe" if info("dialogtrigger") = "No" stop endif if info("dialogtrigger") = "Maybe" if rnd() > 0.5 stop endif endif ... ... ...
The procedure pauses until one of the buttons is clicked. As shown above, the procedure can use the info(“dialogtrigger”) to find out which button was clicked.
Note: Pressing the Enter or Return key is the same as clicking the first button (the button farthest to the right). If the alert contains a Cancel button, pressing the ESC button is the same as clicking on the Cancel button. If there is no Cancel button, the ESC key is ignored.
You can also specify each button separately, like this:
alertmodal "Do you want to continue?","Button","Yes","Button","No","Button","Maybe"
Notice that in this case the option name is button, not buttons.
This option allows you to display additional text in the alert. This additional text is displayed in a smaller, non-bold style.
alertmodal "Operation complete!","TEXT",info("selected")+" records were processed."
Apple has three styles for alerts – Warning, Critical, and Informational. Use the style option to set the alert style you want (the default is Warning).
alertmodal "Gadzooks! Negative balance","style","critical"
You can abbreviate the style down to a single letter.
alertmodal "Gadzooks! Negative balance","style","c"
You can also use ! for critical and ? for informational.
alertmodal "Gadzooks! Negative balance","style","!"
Note: At the time this was written, Apple displays Warning and Informational alerts exactly the same. Critical alerts are displayed with a yellow triangle icon.
Alerts normally appear with the Panorama icon in the upper left hand corner. You can specify a different icon with the icon option. Any image file can be used.
alertmodal "Gadzooks! Negative balance","icon","~/Pictures/DollarSign.png","style","!"
|10.0||New||New in this version. This new statement supercedes the many other statements that earlier versions of Panorama included for displaying modal alerts. These statements are still available for compatibility with legacy databases, but the alertmodal statement offers more options and flexibility and is recommended for new applications.|