home *** CD-ROM | disk | FTP | other *** search
- PROGRAM B;
-
- {$I LISTOF.VAR}
- {$I HEX.INC}
- {$I GETPARAM.INC}
-
- VAR
- S,O,Len : word;
- Is_child : boolean;
-
- PROCEDURE Passback_Status(code : integer);
- BEGIN
- status := Code;
- MOVE(mark1, MEM[S:O], Len);
- END;
-
- PROCEDURE Check_If_Child;
- (* ------------------------------------------------ *)
- (* IF this program is running as a child process, *)
- (* then there will be two valid WORDs on the *)
- (* command line. Assuming we find these words, *)
- (* we set a pointer to the address they define *)
- (* and look for a particular "password" in that *)
- (* area. IF we find it, then we have successfully *)
- (* set up a shared data area with the parent. *)
- (* ------------------------------------------------ *)
- BEGIN
- Get_Parameters(S, O, Is_Child); {in GETPARAM.INC}
- IF Is_Child THEN
- BEGIN
- Len := ofs(mark2) - ofs(mark1);
- MOVE(MEM[S:O], mark1, Len);
- IF keyword = 'BORLANDint' THEN
- BEGIN
- Is_Child := true;
- Passback_Status(3);
- END
- ELSE
- BEGIN
- WriteLn('ERROR in address');
- Is_Child := false;
- END;
- END;
- END;
-
- {$I ERRORHAN.INC}
-
- BEGIN
- ExitProc := @ErrorHandler;
- WriteLn;
- WriteLn(' THIS is program B');
- Check_If_Child;
- IF Is_Child THEN
- BEGIN
- WriteLn(' The string passed from PARENT was "',thing,'"');
- Write(' ENTER LONGINT: '); ReadLn(L);
- Write(' ENTER STRING : '); ReadLn(thing);
- status := 1;
- {status 1 is normal termination}
- END;
- IF Is_Child THEN MOVE(mark1, MEM[S:O], Len);
- END.