[comp.os.vms] C on VMS

hsw@TYCHO.ARPA (Howard Weiss) (01/23/88)

I am a UNIX C programmer and have just recently been playing around with
a VMS system and a C Compiler running on it.  Unfortunately, I don't
have any documentation of the VMS C compiler and I'm having trouble
doing something that seems quite natural to do - command line
argument processing.  I am able to compile and link programs so
that I have a resulting file (foo.exe) which I can then run using
the VMS 'run' command (r foo).  The problem I have it how do I pass
arguments into the program (i.e., UNIX-style, foo -w).  If I give
any args on the VMS 'run' command line, the system complains about
too many parameters.  In addition, touching argv in the C program
either gives bogus information or causes the program to bomb.

Anyone have any good info for me - any and all would be appreciated.

Please respond directly to me - I am not a regular reader of the mailing
list.

Thanks,

Howard Weiss
-------

carl@CITHEX.CALTECH.EDU (Carl J Lydick) (01/25/88)

 > The problem I have it how do I  pass  arguments  into  the  program  (i.e.,
 > UNIX-style, foo -w).  If I give any args on the VMS 'run' command line, the
 > system complains about too many parameters.  In addition, touching argv  in
 > the C program either gives bogus information or causes the program to bomb.

There are at least four ways of doing this:
1)  Define the program as a foreign command; i.e.:
        $ foo:==$sys$login:foo
    Then invoke the program with:
        $ foo -w
2)  Use MCR instead of run; i.e.:
        $ MCR sys$login:foo -w
3)  Use LIB$GET_FOREIGN to read the command line and process it yourself
4)  Use the CLI routines to parse the command line

-------

ritchie@hpldola.HP.COM (Dave Ritchie) (01/29/88)

   define a symbol

   foo :== $ disk:[usrname]filename.exe

   then type foo -w as you would on any unix system.
					Dave Ritchie