about how a process is executed. Boxes can output a message to a user. However,
sometimes multiple messages are generated during processing. Infologs are more
suited to handle multiple messages; there are three types of messages:
Message type | Description |
Information | Important information that does not require any action. |
Warning | Warning when a critical situation occurs. |
Error | When a fatal error occurs and a user must take action |
The following table contains Infolog icons and a description of each method.
Several methods exist to invoke the Infolog system.
The easiest way is to use the info (text) function. This adds the text to the Infolog
system. Any text that is added to the Infolog is displayed when the program
returns to a state of waiting for user input. This is typically at the end of a
process.info("This is an info infolog");The following figure shows the resulting output.
Creating warning or error Infolog messages resemble the example shown
previously in this lesson. The only part of the syntax that changes is the word in
front of the parentheses. The following example shows the syntax for warning
and error Infologs:warning("Infolog text");
error("Infolog text");
The following figure shows the error Infolog message .
The Infolog system is used mostly to display multiple messages at the same time,
in tree form. The following figure shows an example of multiple messages in tree
form.
The setPrefix() function sets the label for the heading of the Infolog tree. In the
example, it specifies the label, 'Infolog Tree'. The following example shows the
syntax of this method:setPrefix("Infolog Tree");
The following figure shows how adding calls to setPrefix() adds multiple levels
to the Infolog tree. The level will continue while the method the setPrefix()statement is called in remains in scope.
Best Regards,
Hossein Karimi
No comments:
Post a Comment