FANDOM


Der answer-Befehl wird eingesetzt, um vom Benutzer eine Bestätigung oder eine Information zu bekommen, bevor der Prozeß fortgesetzt wird. Dafür muss der Benutzer einen der Buttons drücken.

Beispiel:

answer question "Magst Du LiveCode?" with "JA" or "NEIN" or "Vielleicht..."
answer ("Du hast geantwortet "  & it)

Syntax Bearbeiten

answer [iconType] prompt [with button1 [or buttons]] [titled windowTitle] [as sheet]

Parameter Bearbeiten

  • iconType: Das Icon wird auf der linken Seite des Dialogfensters angezeigt. Wenn keines angegeben wird, wird keines angezeigt. Es gibt folgende Typen:
    • "information" - Information
    • "question" - Frage(zeichen)
    • "error" - Fehler
    • "warning" - Warnung
  • prompt (string): The dialog box expands if necessary to fit the contents on desktops, display space on iOS and Android devices can be more restrictive and not provide enough space to expand sufficiently.
  • button1: If no descrition is fournished, the OK button will appair.
  • buttons: Up to seven buttons can be specified, separated by the word "or". The buttons and the dialog box expand if necessary to fit the button names; the total number of characters in the buttons is limited only by the maximum dialog box size and the font size. Display space on iOS and Android devices can be more restrictive and not provide enough space to expand sufficiently. The last button you specify is the default button. Pressing Return or Enter is equivalent to clicking the default button. If you do not specify any button names, the dialog box contains a single OK button.
  • windowTitle: If specified, appears in the title bar of the dialog box. If you do not specify a windowTitle, the title bar is blank.


The prompt can be either formatted text (in the htmlText property format) or plain text. If the prompt contains <p> or a start/end tag pair, the answer command assumes the text is in the same format as the htmlText property. Otherwise, the answer command assumes the text is plain text.

The position and appearance of the dialog box varies between platforms. On Mac OS systems, the dialog box is centered on the screen; on Unix and Windows systems, the dialog box is centered over the active window. On Windows systems, the buttons are shown in reverse order (the first button is on the right side).

On OS X systems, the image specified in the gRevAppIcon variable appears as the application icon in the answer dialog box (unless the answer...as sheet form is used). If you specify an iconType, the image specified in the gRevSmallAppIcon variable is used instead, along with the special icon specified by the iconType.

If the as sheet form is used, the dialog box appears as a sheet on OS X systems. On other systems, the as sheet form has no effect and the dialog box appears normally. Attempting to open a sheet from within another sheet displays the second stack as a modal dialog box instead.