How do I use DISPLAY Statement?

Pauses the simulation and displays a message. The simulation will resume when the user selects OK.

A Display statement stops the simulation, and in this case, shows the value of a variable.

The Display statement is valuable for debugging complex models by stopping the model and displaying one or more critical pieces of information (attribute / variable / function call/mathematical formula.) In addition, the Display statement works well during presentations to stop the model temporarily at predefined times. The display statements might contain hints or words to remind you what to discuss. Pressing enter resumes the simulation. Even if you are interrupted or distracted the model will wait until you proceed.

Syntax

DISPLAY “< text string >” [$< attribute / variable / function call >]
DISPLAY “Now completing the 100th set”
DISPLAY “The current number of entries is: ” $ Var1
DISPLAY “Variable1 = “, $Var1 $ CHAR(13) $ “Attribute1 = ” $ Attr1
or
DISPLAY “Variable1 = ” $ Var1 $ “
Attribute1 = ” $ Attr1

text string The message ProcessModel will display. The text string must be enclosed in quotes.

[attribute / variable / function call] The text string or numeric value you wish to display.

After the original set of information (i.e. text string, variable) the “$” character is used to add additional information (i.e another text string or variable). You can force a carriage return by using the statement CHAR(13). Each new item that is appended to the statement must be prefaced with the “$” character.

Example 1

This example displays a message whenever a new order type begins processing at the current activity. A variable, v_ Last_Order , stores the order type of the last entity processed at the activity. If the current entity’s a_ Order_Type attribute value is different from the previous order type, ProcessModel displays a message stating the new order’s type.

IF Order_Type <> Last_Order THEN
{

DISPLAY “New Order Type: ” $a_Order_Type $ “
v_Last_Order = ” $a_Order_Type_Last

}

Example 2

This example displays the entity name during the simulation.

Display “Entity Name = “, Name

Or

Display “Entity Name = “, Ent(Name)

Using just Name will display the entity number rather than the text name. Name is the system-defined attribute that contains the numeric value of the entity name. Ent(Name) will display the text name of the entity.

Use Display statements in normal model action logic to trigger when a state is achieved or by using a trigger activity for precise timing of the Display statement. See what is a Trigger Activity?

Logic Statements:

Was this article helpful?

Related Articles