home *** CD-ROM | disk | FTP | other *** search
- PROGRAM A;
-
- {$I PASSDATA.TYP}
- {$I GETPARAM.INC}
- {$I HEX.INC}
-
- VAR
- P : ^passdata; {defined in PASSDATA.TYP}
- Is_child : boolean;
-
- PROCEDURE Passback_Status(code : integer);
- BEGIN
- P^.status := Code;
- 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. *)
- (* ------------------------------------------------ *)
- VAR S, O : word;
- BEGIN
- Get_Parameters(S,O,Is_Child); {in GETPARAM.INC}
- IF Is_Child THEN
- BEGIN
- P := Ptr(S,O);
- IF P^.password = 'BORLANDint' THEN
- Passback_Status(3)
- ELSE
- BEGIN
- WriteLn('ERROR in address');
- Is_Child := false;
- END;
- END;
- END;
-
- {$I ERRORHAN.INC}
-
- BEGIN
- ExitProc := @ErrorHandler;
- WriteLn;
- WriteLn(' THIS is program A');
- Check_If_Child;
- IF Is_Child THEN
- BEGIN
- WriteLn(' The name passed from PARENT was "',P^.name,'"');
- Write(' ENTER A STRING : '); ReadLn(P^.name);
- Write(' ENTER AN INTEGER : '); ReadLn(P^.number);
- P^.status := 1;
- {status 1 = normal termination}
- END;
- END.