Command Line Arguments
A FORTRAN program can easily evaluate arguments included on the command line that runs the program. A couple of examples follow.
- The IARGC function returns the number of command line arguments:
N = IARGC ()
- Sets
N to the number of command line arguments
- The GETARG subprogram returns the value of a specified argument:
CALL GETARG(I , STR)
- Puts the
I'th argument into string STR
Environment Variables
The GETENV subprogram provides the values of environment variables. For example, to copy the value of variable
MY_OUT into string
OUTFILE, include in your source file:
CALL GETENV ( 'MY_OUT' , OUTFILE )
댓글 없음:
댓글 쓰기