Syntax:
OUTG <variable>: <file>: <format>: <name>;It is used to write values of a single or indexed variable (with only one index) preceded by a written name. The output is always made for the screen.
<variable>
is the name of an INTEGER or REAL variable. If
it is indexed, the <range>
must follow the <name>
.<file>
is a file variable corresponding to a text file that
the user must define, open and close. If <:file>
is omitted
then the output is displayed in the screen only.<format>
is a Pascal format for the data.<name>
is a string of characters without ' or ;. It
will appear in the written output.
This instruction can be used in nodes of any type.
See instruction REPORT (6.20).
Example:
Lock (R) :: STAY := 3.2; ------------------------------------------- Results (A) :: Ttcs := MSTL(EL_Lock); OUTG Ttcs: WaitFile: 6: 2: Mean waiting at lock entrance ; PAUSE; CLOSE(WaitFile); ENDSIMUL; ------------------------------------------- INIT ------------------------------------------- ACT(Results, 40); ASSIGN(WaitFile, 'Waitf.Pas'); REWRITE(WaitFile); ------------------------------------------- DECL VAR Ttcs: REAL; WaitFile: TEXT;If the mean permanence of messages (ships) queue at the entrance (EL) of the node
Lock
was 7.177, then, when this instruction is
executed, the following is written in the screen and in the
file Waitf.Pas
: Mean waiting at lock entrance 7.18
The procedure PAUSE stops the process to allow to read the output.
OUTG Pass_Number[1..6]: 5: Number of passengers at each bus stop;If the content of the array
Pass_Number
is 2, 4, 12, 7, 5, 16,
then the following is written in the screen:
Number of passengers at each bus stop 1 2 3 4 5 6 2 4 12 7 5 16See examples 1, 6, 18 (GLIDER examples book).