|fileID||-||The index of the TEA file to be run as a subprocess.|
|ProcID||-||The index of the process which will execute the TEA file.|
|c1||-||A char value passed to the subprocess.|
|i1||-||An int value passed to the subprocess.|
|i2||-||An int value passed to the subprocess.|
This routine runs a TEA file in a specific process slot as a subprocess. It passes a char value and two int values as input parameters to the subprocess. (The numbers in the routine name correspond to one char value and two int values.) The calling routine waits until the subprocess is finished before it resumes execution. The subprocess behaves as a subroutine. This provides a means for extending TEA programs beyond the 1K allocation for a single CUP (compiled TEA) file. The typical approach is to run a top-level TEA file as process 0 which runs other TEA files as subprocesses. A file that is run at power-up will automatically start as process 0. The GP 1.0 Module can run 4 processes.
The subprocess must be declared as "void main(char,char,int,int)" and be terminated with a call to subroutine aMulti_Halt. The aMulti_Halt command will signal completion of the subprocess via a semaphore and pass a return value back to the calling process.
(TEA file stored in file slot 0)
n = aMulti_Run12(1,3,10,100,200);
(TEA file stored in file slot 1)
void main(char callingProcID, char c, int i1, int i2)
The first program (0) runs the second program (1) as process 3. The first program passes a char with a value of 10, an int with a value of 100, and an int with a value of 200 to the subprocess. After executing the aMulti_Run12 command, the first program waits until the second program completes execution. The second program exits and returns a value of 310 to the first program (the sum of all the input parameters). The first program assigns that return value to variable n.