Original Author Paul Laughton, 2011
Page 99
De Re BASIC!
The string <title_sexp> becomes the title of the dialog box. The string <message_sexp> is displayed in
the body of the dialog, above the buttons. The strings <button1_sexp>, <button2_sexp>, and
<button3_sexp> provide the labels on the buttons.
You may have 0, 1, 2, or 3 buttons. On most devices, the buttons are numbered from right-to-left,
because Android style guides recommend the positive action on the right and the negative action on the
left. Some devices differ. On compliant devices, tapping the right-most button returns 1.
All of the parameters except the selection index variable <sel_nvar> are optional. If any parameter is
omitted, the corresponding part of the message dialog is not displayed. Use commas to indicate omitted
parameters (see Optional Parameters).
Examples:
Dialog.Message "Hey, you!", "Is this ok?", ok, "Sure thing!", "Don't care", "No way!"
Dialog.Message "Continue?", , go, "YES", "NO"
Dialog.Message , "Continue?", go, "YES", "NO"
Dialog.Message , , b
The first command displays a full dialog with a title, a message, and three buttons.
The second command displays a box with a title and two buttons ­ note that the YES button will be on
the right and the NO button on the left. The third displays the same information, but it looks a little
different because the text is displayed as the message and not as the title. Note the commas.
The fourth command displays nothing at all. The screen dims and your program waits for a tap or the
BACK key with no feedback to tell the user what to do.
Dialog.select <sel_nvar>, <Array$[]>|<list_nexp> {,<title_sexp>}
Generates a dialog box with a list of choices for the user. When the user taps a list item, the index of the
selected line is returned in the <sel_nvar>. If the user taps the screen outside of the selection dialog or
presses the BACK key, then the returned value is 0.
<Array$[]> is a string array that holds the list of items to be selected. The array is specified without an
index but must have been previously dimensioned or loaded via Array.load.
As an alternative to an array, a string-type list may be specified in the <list_nexp>.
The <title_sexp> is an optional string expression that will be displayed at the top of the selection dialog.
If the parameter is not present, or the expression evaluates to an empty string (""), the dialog box will
be displayed with no title.
This command also accepts optional <message_sexp> and <press_lvar> parameters like those described
in the Select command, but they should not be used. The <message_sexp> is ignored and the
<press_lvar> will always be set to 0.