Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!psuvax1!uwm.edu!rpi!dali.cs.montana.edu!milton!seymour From: seymour@milton.u.washington.edu (Richard Seymour) Newsgroups: comp.lang.fortran Subject: Re: Fortran commmand line arguments Message-ID: <4573@milton.u.washington.edu> Date: 29 Jun 90 00:34:00 GMT References: <1990Jun28.153908.4911@caen.engin.umich.edu> Distribution: usa Organization: University of Washington, Seattle Lines: 20 In article <1990Jun28.153908.4911@caen.engin.umich.edu> cys@caen.engin.umich.edu (CAO YUSONG ) writes: > In C, one can retrieve information from command line arguments, i.e. > main(argv,argv) > Then, argv[0] will be the command name itself, argv[1] will be the first > argument to the command, etc. > > Is this also possible in Fortran? This is implementation-dependent. Someone else posted the Sun answer. TheVAX/VMS Fortran answer is the system library function LIB$GET_FOREIGN(result,prompt,result-length,force-prompt) where "result" is the string typed as the command line LESS the actual command. the rest of the arguments are optional: prompt: a string to prompt the user with if they did NOT provide command-line arguments result-length: the number of characters returned by "result" force-prompt: if lowbit is zero, only show "Prompt:" if there were no command arguments, if one, show Prompt: irregardless the function itself returns a typical VMS success value. good luck --dick