message

Type

Procedural Command

Purpose

The message command tells DataEase to display a specified message. The message text can be 255 characters in length. You can tell DataEase to display the message on the status bar or in a standard Windows message box. Each message can be programmed to accept user input. DataEase provides five optional parameters (described below) that let you customize the message window.

Syntax

message "MESSAGE TEXT" [window | pause] [ "MESSAGE TITLE TEXT" ]; [Icon]; [Buttons]; [Beep] .

Usage

Message text can contain a field name, current system variable, a relational operator, a function, and/or a text constant enclosed in quotation marks. To divide the message into multiple lines, insert a vertical bar character (|) to indicate a new line (see Example 1). If you do not specify the window or pause parameter, DataEase displays the message on the status bar by default.

When you choose window, DataEase displays the message text in a standard Windows message box. DataEase automatically pauses and the user is required to press any key to acknowledge the message to resume processing. . Pause also displays a window, and is included for compatibility with previous versions of DataEase.

If you include the message title text parameter, DataEase displays the entered text on the message box title bar. If you exclude this parameter, DataEase displays DataEase Message as a default title.

To include the icon parameter, specify a number which represents one of the Windows icons shown in the table below.

 

Message Command Icon Parameters

 

Icon

Numeric Value

Icon Name

 

 

1

Information Icon

 

2

Exclamation Icon

 

3

Stop Icon

 

4

Question Icon

 

 

If you exclude the icon parameter, DataEase automatically displays the Windows information icon by default.

To include the buttons parameter, specify a number which represents one of the button combinations shown in the table below.

 

Message Command Button Parameters

 

To display this button combination...

...enter this number as the buttons parameter.

 

OK, CANCEL

1

RETRY, CANCEL

2

ABORT, RETRY, IGNORE

3

YES, NO

4

YES, NO, CANCEL

5

 

If you exclude the buttons parameter, DataEase displays the OK, CANCEL button combination by default.

When the user clicks a button displayed in the message box, DataEase returns a value to the current status system-defined variable. The current status values associated with each of the buttons are displayed in the table below.

 

Message Command Current Status Values

 

When you

click this button...

...DataEase Returns this value to the current status variable.

 

OK

1

CANCEL

2

ABORT

3

RETRY

4

IGNORE

5

YES

6

NO

7

 

 

You can use the value stored in the current status variable to perform conditional processing of the remainder of your script as shown in Example 2.

To include an audible warning sound, specify a number which represents one of the standard Windows beep sounds, as shown in the table below.

 

Message Command Beep Parameters

 

To play the sound associated with this Windows icon...

...enter this number.

 

System Default

1

Asterisk

2

Information

3

Exclamation

4

Question

5

Hand

6

Stop

7

OK

8

 

 

If you exclude the beep parameter, DataEase does not provide a default.

When you choose pause, the message is displayed on the status bar. If you include any of the optional parameters with the pause option, DataEase displays an error when you choose Script>>Check DQL.

Example 1

 message "Sorry. A high security level is

 required|to run this procedure" window .

 

This message is displayed in a Windows message box. There are line breaks after the words Sorry and required. By default, DataEase includes the title DataEase Message, the Windows information icon, and the OK, CANCEL button combination.

Example 2

for MEMBERS ;

if EXPIRATION DATE < currentdate then

message jointext ( " Delete " , jointext

( LAST NAME , " record? " ) ) window " Delete

Inactive Member Records " ; 4; 5; 4.

if current status = 6 then-- Yes button

delete records.

message " Record Deleted! " pause .

else

if current status = 7 then-- No button

message " Finding next record. " pause .

else

if current status = 2 then-- Cancel button

message " Cancelling procedure. " pause .

exit .

end

end

end

end

end

 

This example tells DataEase: (1) Process all the records in the MEMBERS table. (2) Check each record to see if the membership has expired as indicated by the EXPIRATION DATE. If the membership has lapsed, display the message: "Delete LAST NAME record?" in a message box that includes the message title "Delete Inactive Member Records", the Question icon, the YES, NO, CANCEL button combination, and plays the exclamation sound. (3) If The user clicks YES, delete the current record and display the message "Record Deleted!" on the status bar, (4) If the user clicks NO, abandon the current record and display the message "Finding next record." on the status bar. (5) If The user clicks CANCEL, display the message "Cancelling procedure." on the status bar and exit the script.