Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!ig!agate!ucbvax!RCCA.BBN.COM!RMCEWEN From: RMCEWEN@RCCA.BBN.COM (Regis McEwen) Newsgroups: comp.os.vms Subject: re: question on chaining images Message-ID: <8803141534.AA28168@ucbvax.Berkeley.EDU> Date: 14 Mar 88 03:42:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 35 >> I am looking for a system service or run-time library routine that >> will allow me to execute a second image. I want to do this in such a >> way that the flow of control will pass entirely to the second image, >> and will return to the first image at the calling point after the >> second image completes. Neither CREPRC nor LIB$SPAWN seem to do this, >> which makes sense since their purpose is to create another process >> altogether. I just want the SAME process to start executing a second >> image. I'm sure I'm overlooking something obvious... >LIB$DO_COMMAND >LIB$RUN_PROGRAM > -- Jerry Neither one of these RTL routines will accomplish what you want. LIB$DO_COMMAND/LIB$RUN_PROGRAM will execute the command/program, respectively, then stop, immediately, *never* returning you to the calling program unless there was an error executing the call. (Assuming, of course, you have appropiate error handling). This is documented in the RTL manual. $CREPRC/LIB$SPAWN will do this, but, as you pointed out, will create another process, sub-process or possibly detached if you specify a UIC in $CREPRC. What you want *used* to be available with pre-VMS V3.? called LIB$EXECUTE_CLI. The only other "unsupported" way to do this, is to build your own calling stack and make a call to SYS$CLI. -Regis