Once more, introducing a new release of EMME/2 also implies introducing new features and enhancements regarding the EMME/2 macro command language. Here is a list of the new macro features available in Release 9:
%tp% | project title |
%ts% | title of current scenario |
%tl% | unit of length text |
%tc% | unit of cost text (now up to 4 characters long) |
%te% | unit of energy consumption text (now up to 4 characters long) |
%tu% | user initials as entered at the start of the session |
%m
TN.n%
and %m
TN.d%
, where
T is the matrix type (f
, o
, d
or s
)
and N is the matrix number.
In addition, the new substitution %m
TN.t%
is
introduced to allow the substitution of the time stamp of the last
modification of the corresponding matrix.~#
... can be used to
add comments into the macro file.
In contrast
to the existing macro comments ~/
... and ~~/
..., this
new type of comment is not intended to be displayed on the screen,
rather it is meant to annotate or document the macro program itself
(i.e. it is only visible when editing or debugging the macro).~>>filename
... is a variant
of the usual save macro file command ~>
. It allows appending lines to an
already existing file.
While the save macro file command ~>
fails if the named file already
exists, the new ~>>
command will work regardless of whether the named file exists
or not. If it does not exist, the ~>>
command behaves
exactly as the ~>
command. If the file already exists, it is opened
and positioned to the end, so that subsequent macro commands will
be appended to the already existing contents.
This new command is not only useful when creating a macro file
interactively. It can, of course, also be called from within
a macro, where it can be used to generate a file containing arbitrary
text information using the new ``quoted output'' command described below.~"
... has been introduced.
In itself, this command is essentially a no-op (no-operation) like the macro program
comment ~#
command, i.e. it does not have any immediate effect on
the macro which is currently running. But if this command is executed
while a macro save command (~>
filename ...)
or macro append (~>>
filename ...) is active, the
characters following the ~"
will be transcribed to
the output file (without the leading ~"
).
This new command, in combination with the ~>
and ~>>
commands, can therefore be used to create arbitrary text files
from within a macro. This provides a system independent
method for creating external files from within a macro, avoiding
all potential problems associated with the use of operating system
dependent ~!
commands to perform the same kind of task
(such as ~!echo
...).~<<
filename
and read record ~@
provide a new mechanism which
allows a macro to read and process arbitrary external text files.
Once a file has been opened with a ~<<
filename command, it
will remain opened until one of the following conditions is met:
~<<
) is executed
The new read record command ~@
reads the next
input record from the previously opened file. The ~@
command is similar to the terminal read command ~*
.
It can either be used alone when the line read is to be executed
as macro or EMME/2 command, or in combination with the
set text register command. E.g. the command ``~t5=~@
''
will read the next record and store it in text register t5
.
Note that each level of macro invocation can have its own separate file open for reading. As is the case with the register values, when a macro calls another macro, the open read file is ``inherited'' by the lower level macro.
%
..._
W%
) use the usual left adjustment for
text registers and right adjustment for numeric registers.
In Release 9 it is now possible to overwrite this default behavior and
force explicit right and left adjustment for any substitution.
This is done by preceding the field width W by ``>
'' (for
right adjustment) or ``<
'' (for left adjustment). E.g.
the substitution ``%t5_>32%
'' places the contents of text
register t5
into a 32 character field, adjusted to the right.