home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Parent;
-
- uses dos;
-
- {$M 8192,8192,8192}
- {$I LISTOF.VAR}
- {$I PASSDATA.TYP}
- {$I HEX.INC}
-
- VAR
- P : passdata;
- tempS : string[6];
- tempO : string[6];
-
- BEGIN
- WriteLn('THIS is the PARENT program.');
- WriteLn('===========================');
- P.password := 'BORLANDint';
- P.status := 0;
- Write('What string shall I pass to the children?:');
- ReadLn(P.name);
- thing := P.name;
- Str(seg(P),tempS);
- Str(ofs(P),tempO);
- Exec('CHILDA.EXE',tempS+' '+tempO);
- WriteLn;
- WriteLn('NOW we are back to the parent program');
- CASE P.status OF
- 0 : WriteLn('WHAT we have here is a failure to communicate');
- 1 : BEGIN
- WriteLn('THE STRING we got is "',P.name,'"');
- WriteLn('THE INTEGER we got is ',P.number);
- END;
- 2 : WriteLn('The user halted the child process with ^Break');
- 3..$FF : WriteLn('OOPS! The child process crashed in an ',
- 'unexpected way.');
- ELSE
- Write('The child process crashed with error $');
- WriteLn(HexByte(P.status AND $FF));
- END;
- status := 0;
- keyword := 'BORLANDint';
- Str(seg(mark1),tempS);
- Str(ofs(mark1),tempO);
- Exec('CHILDB.EXE',tempS+' '+tempO);
- WriteLn;
- WriteLn('NOW we are back to the parent program');
- CASE status OF
- 0 : WriteLn('WHAT we have here is a failure to communicate');
- 1 : BEGIN
- WriteLn('THE LONGINT we got is ',L);
- WriteLn('THE STRING we got is "',thing,'"');
- END;
- 2 : WriteLn('The user halted the child process with ^Break');
- 3..$FF : WriteLn('OOPS! The child process crashed in an ',
- 'unexpected way.');
- ELSE
- Write('The child process crashed with error $');
- WriteLn(HexByte(status AND $FF));
- END;
- END.