Article 126282 of comp.os.vms: Path: nntpd.lkg.dec.com!crl.dec.com!crl.dec.com!bloom-beacon.mit.edu!gatech!news.mathworks.com!usenet.eel.ufl.edu!spool.mu.edu!howland.reston.ans.net!news.cac.psu.edu!news.tc.cornell.edu!newsserver.sdsc.edu!news.cerf.net!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) Newsgroups: comp.os.vms Subject: RE: Skipping inputs in C program?! Date: 3 Aug 1995 00:18:09 GMT Organization: HST Wide Field/Planetary Camera Lines: 67 Distribution: world Message-ID: <3vp4k1$qil@gap.cco.caltech.edu> References: <950802154803.2024d439@technet.nm.org> Reply-To: carl@SOL1.GPS.CALTECH.EDU NNTP-Posting-Host: sol1.gps.caltech.edu In article <950802154803.2024d439@technet.nm.org>, "Cheryl Haaker, New Mexico Technet" writes: =I added one line to your .com file and got it to work. See below: = =|From: accgre@vaxa.hofstra.edu (Gregory E. Rohman, Mechanical Engineering) =|Message-ID: <1995Aug2.163131.6696@vaxa> =| =|The following is an excerpt from a program that I am currently developing. The =|C program below is called from a .COM file, which passes the pid number to =|*argv[]. The C program compiles without any errors. When the program is run, =|however, it does not pause at the input "Enter your name." It just skips over =|it and continues with the program. =| =|------------------------------------------------------------------------------ =|.COM file =|------------------------------------------------------------------------------ =|$context="" =|$num=f$pid(context) = =Add this: =$ x = "$''f$environment("DEFAULT")'x.exe" = =|$x 'num' = =My Output: = -------------------------------------------------- =CHAMA> context = "" =CHAMA> num = f$pid(context) =CHAMA> show sym num = NUM = "0000086B" =CHAMA> x 'num' = =Enter your name : CkHaaker =CHAMA> ds mailtemp* = =Directory TECHNET$DISK:[HAAKER.CC] = =MAILTEMP0000086B.TXT;1 1 2-AUG-1995 15:46:19.74 = =CHAMA> ty MAILTEMP0000086B.TXT;1 = =Name : CkHaaker =CHAMA> = -------------------------------------------------- = =The critical step is defining a symbol (foreign command) to run your =executable. Without this, you cannot pass arguments on the command =line. (In fact, I got a dump when I tried your code as it was!) = =Hope this helps! Congratulations on giving a correct answer to the wrong question. He didn't complain about problems when running things interactively. He complained about problems when using the DCL procedure. Why didn't you use the DCL procedure? Why did you instead enter the commands interactively? The actual problem he was encountering was that the gets() was taking its input from the procedure instead of the terminal. A rather difficult problem to reproduce if you don't use a DCL procedure, is it not? The solution is to: $ DEFINE/USER_MODE SYS$INPUT SYS$COMMAND before invoking the image. -------------------------------------------------------------------------------- Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL Disclaimer: Hey, I understand VAXen and VMS. That's what I get paid for. My understanding of astronomy is purely at the amateur level (or below). So unless what I'm saying is directly related to VAX/VMS, don't hold me or my organization responsible for it. If it IS related to VAX/VMS, you can try to hold me responsible for it, but my organization had nothing to do with it.