Line 17... |
Line 17... |
17 |
|
17 |
|
18 |
|
18 |
|
19 |
=== Batch files support ======================================================
|
19 |
=== Batch files support ======================================================
|
20 |
|
20 |
|
21 |
When SvarCOM executes a command, it checks first if it has a *.BAT extension.
|
21 |
When SvarCOM executes a command, it checks first if it has a *.BAT extension.
|
22 |
If so, it switches into 'batch-mode':
|
22 |
If so, it switches into 'batch-processing' mode:
|
- |
|
23 |
|
23 |
- allocates a batch 'node', which is a memory area that contains the
|
24 |
- Writes the batch filename into its persistent (rmod-owned) buffer, along
|
24 |
path and filename of the batch file, as well as the number of the "next
|
25 |
with a line counter that holds the number of "next line to be executed".
|
25 |
line to be executed".
|
- |
|
26 |
- the batch node is attached to the batch chain (a pointer owned by rmod) if
|
26 |
- When a batch file CALLs another batch file, then a new SvarCOM instance is
|
27 |
the batch file was CALLed from within another batch file, and replaced the
|
27 |
started. This ensures that once the CALLed batch ends, processing will
|
28 |
current batch if it was simply executed from another batch file.
|
28 |
return to the original batch file at the correct position.
|
29 |
|
29 |
|
30 |
When the rmod batch pointer is non-NULL, SvarCOM does not ask the user for a
|
30 |
When the batch buffer is non-zero, SvarCOM does not ask the user for a
|
31 |
command. Instead, it opens the batch file, jumps to the "line line to be
|
31 |
command. Instead, it opens the batch file, jumps to the "next line to be
|
32 |
executed" and loads the command from there, incrementing "next line" in the
|
32 |
executed" and loads the command from there, incrementing this counter in the
|
33 |
process. The maximum length of a batch file is of 65535 lines (any lines after
|
33 |
process. The maximum length of a batch file is of 65535 lines (any lines after
|
34 |
this limit will be ignored).
|
34 |
this limit will be ignored).
|
35 |
|
35 |
|
36 |
|
36 |
|
37 |
====================================================================== EOF ===
|
37 |
====================================================================== EOF ===
|