8.0.4: Under DOS, I cannot specify more than 8 parameters for a macro called from the emme2 command line. What is the problem?
The maximum number of macro parameters which can be processed via the DOS emme2.bat command is 8. This is because a DOS command can have a maximum of 9 parameters (%1 to %9); so, emme2.bat can accept only the macro filename and 8 macro parameters (%1% to %8%).
On the other hand, since Release 9, if a macro is called from within EMME/2, it can access up to 32 parameters (%1% to %32%).
Here is an example:
The simple macro (referred to as simple.mac):
~/ %0% %1% %2% %3% %4% %5% %6% %7% %8% %9% %10%
~/ %0% %11% %12% %13% %14% %15% %16% %17% %18% %19% %20%
~/ %0% %21% %22% %23% %24% %25% %26% %27% %28% %29% %30%
~/ %0% %31% %32%
should display the list of the 32 parameters:
<~/ 32 1 2 3 4 5 6 7 8 9 10
<~/ 32 11 12 13 14 15 16 17 18 19 20
<~/ 32 21 22 23 24 25 26 27 28 29 30
<~/ 32 31 32
If the macro is called with the 32 parameters directly from the DOS prompt or from a batch file:
- DOS prompt:
-
- emme2 -m simple.mac 1 2 3 4 5 6 7 ... 25 26 27 28 29 30 31 32
- batch file:
-
- call emme2 -m simple.mac 1 2 3 4 5 6 7 ... 25 26 27 28 29 30 31 32
the result will be:
-
- <~/ 8 1 2 3 4 5 6 7 8
-
- <~/ 8
-
- <~/ 8
-
- <~/ 8
instead of the one expected. Unfortunately, as explained above, this is due to the DOS limitation.
However, it is possible to circumvent this problem by creating a macro with 32 parameters that can be called from within EMME/2, as follows:
- create a starting macro (referred to as starting.mac) which contains the original line that was in the batch file, slightly modified. Starting mac should contain the line:
-
- ~< simple.mac 1 2 3 4 5 6 7 ... 25 26 27 28 29 30 31 32
- in the batch file, call the macro starting.mac which has no parameters (instead of the macro simple.mac):
-
- call emme2 -m starting.mac
The result will be:
-
- <~/ 32 1 2 3 4 5 6 7 8 9 10
-
- <~/ 32 11 12 13 14 15 16 17 18 19 20
-
- <~/ 32 21 22 23 24 25 26 27 28 29 30
-
- <~/ 32 31 32