Subversion Repositories SvarDOS

Rev

Rev 576 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 576 Rev 949
Line 30... Line 30...
30
=== BATCH FILES SUPPORT ======================================================
30
=== BATCH FILES SUPPORT ======================================================
31
 
31
 
32
When SvarCOM executes a command, it checks first if it has a *.BAT extension.
32
When SvarCOM executes a command, it checks first if it has a *.BAT extension.
33
If so, it switches into 'batch-processing' mode:
33
If so, it switches into 'batch-processing' mode:
34
 
34
 
-
 
35
 - allocates a "batch context" structure and attach it to rmod
35
 - Writes the batch filename into its persistent (rmod-owned) buffer, along
36
 - writes the batch filename into the batch context (rmod-owned) memory, along
36
   with a counter that holds the offset of the next line to be executed.
37
   with a counter that holds the offset of the next line to be executed.
-
 
38
 - a batch context has a "parent" pointer that may point to another batch
-
 
39
   context (owned by a different batch instance), it is, in essence, a linked
-
 
40
   list that allows batch files to call one another (typicall through the CALL
-
 
41
   command) allowing SvarCOM to get back to the parent batch once the child
-
 
42
   terminates.
37
 
43
 
38
When the batch filename buffer is non-empty, SvarCOM does not ask the user for
44
When the rmod batch context pointer non-NULL, SvarCOM does not ask the user for
39
a command. Instead, it opens the batch file, jumps to the "next line to be
45
a command. Instead, it opens the batch file, jumps to the "next line to be
40
executed" and loads the command from there, incrementing the line counter in
46
executed" and loads the command from there, incrementing the line counter in
41
the process.
47
the process.
42
 
48
 
43
 
49