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