OPEN Function (Dialog)

Opens a dialog window.


Dialog.OPEN(String [, Variable1],...)

Parameters

Dialog

Type: Dialog

After you define this variable, you can open the dialog and then use other dialog functions.

String

Type: Text constant or code

This string contains the text that you want to display in the window. Use a backslash (\) to start a new line. Use number signs (#) to insert variable values into the string. Place the number signs where you want to substitute the variable value. Place a number in the part of the string where a variable value will be substituted (for example, #1####) to be able to reference this field for updating.

If you use @ characters instead of # characters, then the variable value is used as a percentage and is displayed as a progress indicator. The value that is displayed is the percentage from 0 to 9999.

The number of # or @ characters in the string indicates the length of the field or progress indicator.

You can update the fields using the UPDATE Function (Dialog) or INPUT Function (Dialog) or by letting the user edit the values.

Variable1

Type: Any

Use these optional parameters to specify variables for field1, field2, and so on.

Dialog windows opened by an object are closed when the object terminates.

Dialog windows are automatically sized to hold the longest line of text and the total number of lines.

We recommend the following guidelines:

  • Enter messages as text constants.

  • Write messages using active voice. For example, write “Processing items” instead of writing “Items are being processed.”

  • Align the # and @ fields to the left with at least one space character between the text and the variable.

This example shows how to use the dialog.OPEN function.

This code example requires that you create the following variables.

Name Data type

AccountInfo

Text

AccNo

Integer

TotSum

Integer

MyDialog

Dialog

Next

Integer

This example requires that you create the following text constants.

Name ConstValue

Text000

Account no. #1######,\

Text001

has a total of $ #2######

AccountInfo := Text000 + Text001;
AccNo := 5634;
TotSum := 1000;
MyDialog.OPEN(AccountInfo, AccNo, TotSum);
REPEAT
  // Do some processing.
  …
  MyDialog.UPDATE(); // Update the fields.
UNTIL Next = 0;
MyDialog.CLOSE()

The dialog window opens and displays this text:

Account no.. . . . . 5634,

has a total of $. . . . . . . 1000

This shows that the values of the AccNo and TotSum variables have been formatted into the '#'-fields.

Community Additions

ADD
Show: