PSMessages Collection Methods
This section describes the PSMessages collection methods. The methods are discussed in alphabetical order.
Syntax
DeleteAll()
Description
The DeleteAll method deletes all the PSMessage objects in the PSMessages collection executing the method. You should use this property after you have processed all the errors in the collection. This method also resets the status of ErrorPending to False.
Returns
This method returns a Boolean value: True if all PSMessages in the collection were successfully deleted, False otherwise.
Syntax
DeleteItem(number)
Description
The DeleteItem method deletes the PSMessage object that exists at the number position in the PSMessages collection executing the method.
Parameters
Field or Control |
Definition |
---|---|
number |
Specify the position number in the collection of the PSMessage object that you want to delete. All other items within the collection are renumbered. |
Returns
This method returns a Boolean value: True if the PSMessage object was successfully deleted, False otherwise.
Example
&ERROR.DeleteItem(&I);
Syntax
First()
Description
The First method returns the first PSMessage object in the PSMessages collection object executing the method.
Example
&ERROR = &PSMESSAGE.First();
Syntax
Item(number)
Description
The Item method returns a PSMessage object that exists at the number position in the PSMessages collection executing the method
Parameters
Field or Control |
Definition |
---|---|
number |
Specify the position number in the collection of the PSMessage object that you want returned. |
Returns
A reference to a PSMessage object, NULL otherwise.
Example
&PSMSGCOL = &SESSION.PSMessages;
For &I = 1 to &PSMSGCOL.Count;
&PSMESSAGE = &PSMSGCOL.Item(&I);
/* do error processing */
End-For;
Syntax
Next()
Description
The Next method returns the next PSMessage object in the PSMessages collection object executing the method. You can use this method only after you have used either the First or Item methods: otherwise the system doesn’t know where to start.