Download here in PDF

Transcript
568 CHAPTER 13
The optional third argument, 'REPORT_HEADER', is used when you wish to place a header string on
the report.
You can refer to the LOOPOLE model in the Samples folder for an example of a model that uses the
@SOLU command
@WRITE( ‘TEXT1’|VALUE1[, …, ‘TEXTN’|VALUEN])
The @WRITE statement is the primary tool you’ll use for displaying output in calc sections. @WRITE
can display both text and variable values. Text strings are delimited with single or double-quotes. All
output will be directed to the screen unless @DIVERT (discussed below) is used to route output to a
file.
@WRITE is useful for both debugging your calc section code and for generating custom reports. As
an example, the following product mix model uses @WRITE statements in a calc section to construct a
custom report:
MODEL:
[PROFIT] MAX = 200 * WS + 300 * NC;
[CHASSIS1] WS <= 60;
[CHASSIS2] NC <= 40;
[DRIVES] WS + 2 * NC <= 120;
CALC:
@SOLVE();
@WRITE( 'Total profit = ', PROFIT, @NEWLINE( 1));
@WRITE( 'Production:', @NEWLINE( 1));
@WRITE( '
WS = ', WS, @NEWLINE( 1),
'
NC = ', NC, @NEWLINE( 1),
'Total units = ', WS + NC,
@NEWLINE( 2)
);
@WRITE( 'Dual analysis:', @NEWLINE( 1),
'
Chassis1: ', @DUAL( CHASSIS1),
@NEWLINE( 1),
'
Chassis2: ', @DUAL( CHASSIS2),
@NEWLINE( 1),
'
Drives:
', @DUAL( DRIVES),
@NEWLINE( 1)
);
ENDCALC
END