[comp.lang.fortran] command line argument in Fortran?

xiaohe@CitRomeo.BITNET (Xiao-He Zhang) (03/10/90)

Greetings!

    I have a question: can Fortran programs be compiled to take command line
arguments like C, with or without some tricks?  In other words, can I have
   a.out -argument(s)    ?

Thank you very much in advance!

raw@math.arizona.edu (Rich Walters) (03/11/90)

In article <900310015025.24a08b20@Romeo.Caltech.Edu> xiaohe@CitRomeo.BITNET (Xiao-He Zhang) writes:
>
>Greetings!
>
>    I have a question: can Fortran programs be compiled to take command line
>arguments like C, with or without some tricks?  In other words, can I have
>   a.out -argument(s)    ?
>
>Thank you very much in advance!


The FORTRAN on SUN's (UNIX) has a (non-standard) function called getopt that
returns the command line arguments kinda like C.  There is also a very nice
C function called optarg (?).  Try reading the man page intro(3F).  It should
list any non-standard functions/porcedures like this.


			Richard Walter

-------------------------------------------------------------------------------

			Keep on crunching those numbers

-------------------------------------------------------------------------------