Home   :   Matrix Language   :   Utility Statements   :   Stream Statements

Stream Statements

 

Statement

 

Stream

Display

 

 

General

 

Stream statements provide an easy and convenient means to write text files to a device.

 

When a Template statement writes text output it is usually sent to the console. The Stream statement redirects this output to a file.

 

These statements were specifically designed to be used in Model Compilers as they normally require source code files to be created. However, the Stream statement has other applications such as logging.

 

 

Stream Statement

 

Stream

M:\Matrix\Scenarios\Engine_Management\Logging\Stream.txt

 

The Stream statement specifies the name of the file that is to be created. The following directives are allowed to appear in the Stream subregion:

 

<<|>>

<<#>>

<<StringUpperCase:>>

<<StringLowerCase:>>

<<StringSentenceCase:>>

<<StringCapitalCase:>>

<<StringRemoveSpaces:>>

<<StringConvertUnderlines:>>

 

The following Stream statement options can be selected:

 

Stream

NULL:

 

This has the effect of closing the stream. Any further Template output is ignored.

 

Stream

DISPLAY:

 

The DISPLAY: option also closes the file stream and but redirects Template output to the console.

 

 

Display Statement

 

Display

<<TabIn>>

<<:>>Starting Display

<<:>>

<<TabOut>>

<<:>>

<<:>>

 

The Display statement allows text to be written to the console even if Template statement text has been redirected to a file.

 

The following directives are allowed to appear in the Display statement sub-region:

 

<<:>>

<<|>>

<<#>>

<<TabIn>>

<<TabOut>>

<<SetTabLevel>>

<<StringUpperCase:>>

<<StringLowerCase:>>

<<StringSentenceCase:>>

<<StringCapitalCase:>>

<<StringRemoveSpaces:>>

<<StringConvertUnderlines:>>

 

 

Example

 

Template

<<:>>This text goes to the console.

Stream

M:\Matrix\Scenarios\Engine_Management\Logging\

<<StringCapitalCase:Engine.Name>>_<<#Engine.Number>>.txt

Template

<<:>>This text goes to the file.

Display

<<TabIn>>

<<:>>This text goes to the console.

<<TabOut>>

Template

<<:>>This text goes to the file.

Stream

NULL:

Template

<<:>>This text is ignored.

Display

<<:>>This text goes to the console.

Stream

DISPLAY:

Template

<<:>>This text goes to the console.

Copyright © 2017 Dark Matter Systems Ltd. All Rights Reserved.