



Using ASET There are two modes of operation:
Command line operation: This is the default mode, which is used whenever ASET
is started without the /f switch. Some examples for command line mode
are
|
-r
option.
File operation: This mode is used if ASET is invoked with the /f switch. It then
reads its input from a file, not from the command line. This file is expected to
contains lines like the above. There can be an arbitrary number of these lines. Empty
lines or lines starting with '#' are treated as comment lines, and ignored. Lines
longer than 255 characters are truncated.
If you use /f without an argument, ASET reads commands from the standard
input. Examples:
|
MYINST.CMD. This gives you
a nice possibility to store several configuration settings in different files, and let
ASET execute one of them according to your installment needs.
In the second example, CMDGEN is expected to write ASET commands on standard output. ASET will then read these commands and execute them.
The third example shows how ASET can be used as a calculator. It reads
commands from the keyboard until you input Ctrl/Z. This behaviour is due
to the empty filename parameter of the /f switch. See below for the /n
switch.
Besides the /f option which switches between command line and file mode, there
are some other options:
-e Normally, ASET sets a shell variable to a value which is calculated in
a certain formula. It then finishes operation. -e lets ASET set the
ERRORLEVEL in addition to the shell variable. The ERRORLEVEL can
only be set to values 0..255. This makes it necessary to make some
assumptions:
-e makes it impossible to determine whether ASET has been invoked
with -h, -H, or -v (in these cases the ERRORLEVEL is set to 1) or if a
runtime error occurred (in which case it is set to 255). The -e switch can be a
powerful enhancement to your batch files. Consider the following batch
file:
|
-e makes
ASET set the ERRORLEVEL accordingly, ie. in this case that ERRORLEVEL
will be 1.
You may wonder why I built in the -e facility, because it would also have been
possible to write
|
-e is the solution to both
problems.
-n ASET will not modify the environment. It only calculates the result
and displays it, if -e is not specified. If -e is specified together with
-n, nothing is displayed (unless you force it with -p, of course). -n is
useful if you want to use ASET as a calculator only or if you want
ASET to set the ERRORLEVEL without modifying any environment
variables.
-p ASET will show the result on standard output in addition to modifying the
environment.
-r ASET will repeat the assignment on standard output before actually executing
it. This eases debugging in file mode.


