PSMessagesMode property: Session class
Description
This property is used to determine how messages are output. This property takes either a numeric value or a constant. The default value is 1 (%PSMessages_CollectionOnly).
You must set this property before you check the type of message, that is, you can't check the type of message, then decide how it's displayed.
This property sets the value for the session. You can change modes during a session, such as, if you're starting a Component Interface. However, after you run the Component Interface, you should set the value back. For example:
&OldMode = &Session.PSMessageMode;
&Session.PSMessagesMode = 1;
...
&Session.PSMessagesMode = &OldMode;
You can specify either a numeric value or a constant. The values are:
| Numeric Value | Constant Value | Description |
|---|---|---|
|
0 |
%PSMessages_None |
None. |
|
1 |
%PSMessages_CollectionOnly |
PSMessage Collection only (default). |
|
2 |
%PSMessages_MessageBoxOnly |
Message box only. |
|
3 |
%PSMessages_Both |
Both collection and message box. |
Note:
If you set this property to 0 (%PSMessages_None), all messages are ignored. Use this option with caution.
This property is read/write.
Example
Local ApiObject &SESSION;
&SESSION = %Session;
&MMODE = &SESSION.PSMessagesMode;
&SESSION.PSMessagesMode = %PSMessages_MessageBoxOnly;