Trail: PROIV Documentation > Developer > PROIV Developer > Developing Functions > Events and Logic > MSG

 

 

Purpose

MSG (Error Message) displays user-defined messages when an error occurs in processing.
 

Syntax

MSG (operand1 {operand2,} {operand3}…)
 

Operation

operand1 is any valid numeric constant, variable, expression, or operation whose value represents an error message number from 1 to 255.

operand2 etc
 
are parameters to the MSG command.  The messages should have replaceable tokens to be substituted by these parameters.  The placeholders are placeholder numbers prefixed by a “%" (percent) sign.
 

Remarks

Numeric tags identify user-defined error messages, with values from 1 to 255.  An error message number is local to the function in which it is defined (i.e. error message 1 in function CUST and error message 1 in function INV are separate entities).

Error message definition is optional and completely dependent on the requirements of the function.

Error messages are displayed on the last line of the CRT screen.  If multiple messages are requested, the first error message appears.  

If the error message number is not defined in the message file the MSG statement is treated as a blank error message.  This can be used to suppress display of system error messages.

If there are no place holders in the defined message any parameters that are passed with the MSG command will be ignored.

The maximum length of a message with the parameters substituted is 80 characters.  The message is truncated if it is longer than 80 characters.

Error messages defined in Global Logic are local to the Global Logic.

 

On Read Error Logic

In logic associated with the event process point On Read Error, a user-defined message overrides the system error message.  When developing an application, MSG should be used in On Read Error logic to display customized error messages that are meaningful to the operator.
 

Dynamic Object Logic

In logic associated with a Dynamic Object, a user-defined message is treated as a warning message.  Executing an MSG command here does not affect processing control.
 

General Check Logic

In logic associated with the event process point General Check, a user-defined message is treated as an error message.  Issuing a message in General Check logic affects processing control.  If MSG is executed in General Check logic, the message appears and PROIV re-prompts for input of the field.
 

Special Check Logic

A Global Logic may be specified as a special check.  In this logic a user-defined message is treated as an error message.  Issuing a message in special check logic affects processing control.  If MSG is executed in Special Check logic, the message appears and PROIV re-prompts for input of the field.
 

Example 1

IF #INPUT > 500 THEN
          MSG(1)
ENDIF

where message 1 has been defined as VALUE ENTERED MUST NOT EXCEED 500.
 

Example 2

IF #INPUT > 500 THEN
                MSG(1,"GREATER")
ENDIF
IF #INPUT < 500 THEN
                MSG(1,"LESS")
ENDIF

where message 1 has been defined as VALUE ENTERED IS % 1 THAN 500

If #INPUT is 400 the following appears: "VALUE ENTERED IS LESS THAN 500"
If #INPUT is 600 the following appears: "VALUE ENTERED IS GREATER THAN 500".
 

Comment on this topic

Topic ID: 520093

 
 
 

Table of Contents

Index

Glossary

-Search-

Back