17. Forms Statements : message Statement--Print a Message
 
Share this page                  
message Statement--Print a Message
This statement prints a message on the screen.
Syntax
message string
    [with style=menuline | popup
    [(option=value {, option=value})]]
Description
The message statement with no style clause or with style=menuline prints a one-line character string on the menu line. String must be either a quoted string literal or a program string variable. The maximum message length is the width of the screen. If the message length is greater than the width of the screen, only the characters that fit are displayed. If the message contains newline characters, the newlines are displayed as line breaks (carriage return-line feed).
A message statement that specifies with style=popup displays the message string in a pop-up box on the screen at a location specified by the programmer. The message can be more than one line. The message remains on the screen until the user enters a carriage return. (The FRS prompts for the carriage return following the message text.)
The starting location and size of the pop-up are determined by the values selected for the options. The options are:
startrow
Specifies the row position of the upper left hand corner of the pop-up
columns
Specifies the number of columns, including the borders, occupied by the pop-up
rows
Specifies the number of rows, including the borders, occupied by the pop-up
You can specify the values assigned to the options using integer literals, integer variables or default. If you specify default, the following FRS default values are used:
startcolumn--The second column
startrow--The size of the message determines the row position
columns--The width of the screen minus 2
rows--The number of rows required to display the message, plus one row for the carriage return prompt. The default row value cannot exceed the number of rows in the screen minus one row for the menu line.
The integer equivalent to the keyword default is 0.
The starting location, described by the startcolumn and startrow options, cannot be less than 1,1, which describes the screen origin at the upper left hand corner of the screen. Column and row values increase as you move to the right and down the screen, respectively.
If the starting location is defaulted, the FRS selects a location that displays the pop-up directly above the menu line.
The columns and rows options describe the size of the pop-up box. The box must be at least 16 columns by 4 rows, and must allow room for the borders of the box. If the box size and starting location force the box to be wholly or partially off-screen, the FRS attempts to adjust the starting location so that the entire box can be displayed on the screen. The message is not displayed unless the entire box fits on the screen.
It is good practice to follow a message statement that does not have a style=popup clause with a sleep statement, to ensure that the message remains visible long enough for the user to read it. However, if the statement following message is a statement that can require some time to process, do not add more time with a sleep statement.
Examples--message statement:
Example 1:
Display a message for three seconds.
exec frs message 'Please enter an employee number';
 exec frs sleep 3;
Example 2:
Display a message before initializing two forms. Do not sleep, as the forminit can take a few seconds to complete.
exec frs message 'Initializing forms ...';
 exec frs forminit empform, deptform;
Example 3:
Display a pop-up error message from a buffer using defaults for its position and size.
exec frs message :errorbuf with style=popup;