Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Command Index > D

DIALOG (Short Name: DIA)

Scroll Prev Top Next More

Use the DIALOG command to display a dialog box on the screen to accept text entry from a user. For assistance with building your DIALOG commands, refer to the R:Dialog Builder Plugin, or the R:Dialog with Buttons Builder Plugin.

 

DIALOG

 

Options

 

'message'

Specifies the text of the message to display in the dialog box. The value can also be passed as a variable. The limit is 2000 characters.

 

||format

Also known as EditMask. You can apply the mask specified by the EditMask parameter to the text string specified by the Value parameter. See the "||format" subchapter for more.

 

=w

Specifies the wrap width for the dialog box message.

 

response

Specifies the variable that will contain the dialog box entry. The input field allows for 100 characters per line.

 

=w

Specifies the width for the dialog box entry.

 

endkey

Specifies the variable containing the final keystroke ([Enter] or [Esc]) in a dialog box.

 

lines

Specifies the number of lines to display for the text entry in a dialog box. Up to 25 lines are allowed.

 

password

Displays the dialog box entry as asterisks.

 

YES

Creates a Yes/No dialog box and sets the default response to Yes.

 

NO

Creates a Yes/No dialog box and sets the default response to No.

 

CAPTION 'message'

Specifies the text of the message to display in the dialog box caption. The value can also be passed as a variable.

 

ICON value

 

Icon "value" Parameter

Icon

 

APPS

Aplication

 

ATTENTION

attention

 

CONFIRM

Confirm

 

ERROR

error

 

HELP

help_cmd

 

INFO

information

 

QUESTION

question

 

SERIOUS

serious

 

STOP

stop

 

WARNING

warning

 

WINDOWS

windows *

* will vary based upon Windows operating system

 

 

Additional OPTION parameters

Additional parameters are available to increase the visual display of the DIALOG window. To use the graphic DIALOG Builder, choose "Utilities" > "Plugins" >"DIALOG Builder" from the main menu bar. All OPTION parameters and values must be separated by the "|" (pipe) character.

 

OPTION Parameters

Description

Message

Changes how the DIALOG "message" is displayed

Input Field

Changes how the DIALOG "input field" is displayed

Buttons

Changes how the DIALOG "buttons" are displayed

Window

Changes how the DIALOG "window" is displayed

Popup Menu

Add a "custom popup menu" to the DIALOG window

 

Examples

 

Example 01: (Dialog with custom button text)

 

CLS

DIALOG 'Enter Last Name' vLastName=26 vEndKey 1 +

CAPTION 'Search Employee by Last Name' +

ICON 'APP' +

OPTION MESSAGE_FONT_COLOR BLACK +

|TRANSPARENCY 255 +

|WINDOW_BACK_COLOR WHITE +

|BUTTON_OK_CAPTION '&Search' +

|BUTTON_CANCEL_CAPTION '&Cancel'

 

Example 02: (Dialog with PASSWORD option)

 

CLS

DIALOG 'Enter Password' vPassword=26 vEndKey PASSWORD +

CAPTION 'Database Maintenance' +

ICON 'APP' +

OPTION MESSAGE_FONT_COLOR BLACK +

|TRANSPARENCY 255 +

|WINDOW_BACK_COLOR WHITE +

|BUTTON_OK_CAPTION '&Process' +

|BUTTON_CANCEL_CAPTION '&Cancel'

 

Example 03: (Dialog with Multi-Line Message with the TOP LEFT parameters)

 

-- (CHAR(009)) = Tab Key (Indent)

-- (CHAR(013)) = Carriage Return

CLS

SET VAR vMsg = +

('Line 1:'+(CHAR(009))+(CHAR(009))&'Contents of Line 1'+(CHAR(013))+ +

'Line 2:'+(CHAR(009))+(CHAR(009))&'Contents of Line 2'+(CHAR(013))+ +

'Line 3:'+(CHAR(009))+(CHAR(009))&'Contents of Line 3'+(CHAR(013))+ +

'Line 4:'+(CHAR(009))+(CHAR(009))&'Contents of Line 4'+(CHAR(013))+ +

'Line 5:'+(CHAR(009))+(CHAR(009))&'Contents of Line 5'+(CHAR(013))+ +

'Line 6:'+(CHAR(009))+(CHAR(009))&'Contents of Line 6'+(CHAR(013))+ +

'Line 7:'+(CHAR(009))+(CHAR(009))&'Contents of Line 7'+(CHAR(013))+ +

'Line 8:'+(CHAR(009))+(CHAR(009))&'Contents of Line 8'+(CHAR(013))+ +

'Line 9:'+(CHAR(009))+(CHAR(009))&'Contents of Line 9'++(CHAR(013)))

DIALOG .vMsg vYesNo vEndKey YES +

CAPTION ' Your Dialog Caption Here ...' +

ICON 'APP' +

OPTION MESSAGE_FONT_COLOR BLACK +

|TRANSPARENCY 255 +

|WINDOW_BACK_COLOR WHITE +

|BUTTON_YES_CAPTION '&Start' +

|BUTTON_NO_CAPTION '&Cancel' +

|BUTTON_YES_COLOR GREEN +

|BUTTON_NO_COLOR RED +

|BUTTON_YES_FONT_COLOR WHITE +

|BUTTON_NO_FONT_COLOR WHITE +

|TOP 50 +

|LEFT 50

 

Example 04: (Dialog with button images and custom message format)

 

CLS

SET VAR vResponse TEXT = NULL

SET VAR vEndKey TEXT = NULL

DIALOG 'DIALOG Message Here ...' vResponse=26 vEndKey 1 +

CAPTION 'DIALOG Caption Here ...' ICON 'APPS' +

OPTION MESSAGE_FONT_COLOR GREEN +

|MESSAGE_FONT_NAME ARIAL +

|MESSAGE_BOLD OFF +

|WINDOW_BACK_COLOR WHITE +

|BUTTON_OK_CAPTION '&Continue' +

|BUTTON_CANCEL_CAPTION 'C&ancel' +

|BUTTON_YES_COLOR WHITE +

|BUTTON_NO_COLOR WHITE +

|BUTTON_YES_FONT_COLOR GREEN +

|BUTTON_NO_FONT_COLOR RED +

|BUTTONS_SHOW_GLYPH ON

 

Example 05: (Dialog with a custom input field background color with autoselect enabled)

 

DIALOG 'Please enter last name to search:' vResponse vEndKey 1 +

CAPTION 'DIALOG Window' ICON 'INFO' +

OPTION MESSAGE_FONT_COLOR 2147483647 +

|MESSAGE_FONT_NAME Tahoma +

|INPUT_FONT_COLOR RED +

|INPUT_FONT_SIZE 12 +

|INPUT_BACKGROUND_COLOR 9234160 +

|MESSAGE_BOLD ON +

|AUTOSELECT TRUE

 

Example 06: (Dialog window using Themes)

 

DIALOG 'DIALOG Message Here ...' vResponse=26 vEndKey 1 +

CAPTION 'DIALOG Caption Here ...' ICON 'APPS' +

OPTION THEMENAME Longhorn

 

Example 07: (Dialog with Custom Buttons)

 

SET VAR vCaption TEXT = 'Run Monthly Routines'

SET VAR vYesNo TEXT = NULL

SET VAR vEndKey TEXT = NULL

CLS

DIALOG 'You have selected to run monthly routines' vYesNo vEndKey No +

CAPTION .vCaption +

ICON QUESTION +

OPTION WINDOW_BACK_COLOR WHITE +

|MESSAGE_BACK_COLOR WHITE +

|MESSAGE_FONT_NAME Tahoma +

|MESSAGE_FONT_COLOR RED +

|MESSAGE_FONT_SIZE 12 +

|BUTTON_YES_CAPTION &Yes +

|BUTTON_YES_COLOR WHITE +

|BUTTON_YES_FONT_COLOR GREEN +

|BUTTON_YES_FONT_NAME Tahoma +

|BUTTON_YES_FONT_SIZE 11 +

|BUTTON_YES_FONT_BOLD ON +

|BUTTON_YES_WIDTH 85 +

|BUTTON_NO_CAPTION &No +

|BUTTON_NO_COLOR WHITE +

|BUTTON_NO_FONT_COLOR RED +

|BUTTON_NO_FONT_NAME Tahoma +

|BUTTON_NO_FONT_SIZE 11 +

|BUTTON_NO_FONT_BOLD ON +

|BUTTON_NO_WIDTH 85 +

|BUTTON_HEIGHT 35

IF vYesNo = 'No' OR vEndKey = '[Esc]' THEN

 GOTO Done

ENDIF

-- Do what you have to do here ...

LABEL Done

CLS

CLEAR VARIABLES vCaption,vYesNo,vEndKey

RETURN

 

Example 08: (Dialog with cursor position and R:BASE On-Screen Keyboard - ROSK):

 

SET VAR vResponse TEXT = 'Thank you'

DIALOG 'Message ...' vResponse vEndKey  1  +

CAPTION 'DIALOG Window' ICON INFO +

OPTION MESSAGE_FONT_COLOR 2147483647 +

|MESSAGE_BACK_COLOR -16777201+

|MESSAGE_FONT_NAME Tahoma+

|MESSAGE_FONT_SIZE 10+

|MESSAGE_BOLD ON+

|TOP 200 +

|LEFT 200 +

|CURSOR_POS 6 +

|ROSK_BUTTON ON

 

Example 09: (Dialog with Table Lookup Popup)

 

DIALOG 'Enter Contact to Edit' vContactNo=26 vEndKey 1 +

CAPTION 'Contact Info' +

ICON APP +

OPTION DIALOG_EDIT_HINT 'Double-Click for a List of Contacts' +

|POPUP_ENABLED TRUE +

|POPUP_DIALOG_TYPE LOOKUP +

|POPUP_TITLE_FONT_NAME VERDANA +

|POPUP_TITLE_FONT_SIZE 10 +

|POPUP_TITLE_FONT_BOLD TRUE +

|POPUP_TITLE_FONT_COLOR GREEN +

|POPUP_TITLE_BACK_COLOR WHITE +

|POPUP_TITLE_TEXT 'Select Contact to Edit' +

|POPUP_LIST_FONT_COLOR GREEN +

|POPUP_LIST_BACK_COLOR WHITE +

|POPUP_CAPTION 'List of Contacts' +

|POPUP_TABLE Contact +

|POPUP_SELECT ContFName,ContLName,ContPhone,ContEMail  +

|POPUP_RETURN_COLUMN ContID +

|POPUP_WHERE ORDER BY ContFName +

|POPUP_SHOW_LINES TRUE +

|POPUP_RETURN_TYPE COLUMN +

|POPUP_LINES 20 +

|POPUP_DISTINCT TRUE