home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!mips!darwin.sura.net!jvnc.net!rutgers!concert!borg!debussy!taylorr
- From: taylorr@debussy.cs.unc.edu (Russell Taylor)
- Newsgroups: comp.lang.fortran
- Subject: Re: Unix ARGC,ARGV in Fortran 77
- Message-ID: <14549@borg.cs.unc.edu>
- Date: 18 Aug 92 12:26:39 GMT
- References: <14542@borg.cs.unc.edu>
- Sender: news@cs.unc.edu
- Organization: The University of North Carolina at Chapel Hill
- Lines: 92
-
- In article <14542@borg.cs.unc.edu> marshall@marshall.cs.unc.edu (Jonathan A. Marshall) writes:
- >I need to write a Fortran program that will accept command-line arguments.
- >I'm running Ultrix f77 on a DECstation 5000. In C, command-line arguments
- >can be passed with argc and argv.
- >
- >How is this done in f77? There's got to be a way, right?
- >
- "man -k arg" on tyrosine reveals:
- getarg, iargc (3F) - return Fortran command-line argument
- On the decstation there are no such man pages, so here are the
- tyrosine versions. Note that tyrosine (iris) is a System V unix, so
- who knows if they are the same?
-
- GETARG(3F) Silicon Graphics GETARG(3F)
-
- NAME
- getarg, iargc - return Fortran command-line argument
-
- SYNOPSIS
- character*N c
- integer i, j
- integer function iargc
-
- call getarg(i, c)
- j = iargc()
-
- DESCRIPTION
- getarg returns the i-th command-line argument of the current process.
-
- iargc returns the index of the last argument.
-
- foo arg1 arg2 arg3
-
- getarg(2, c) would return the string ``arg2'' in the character variable
- c.
-
- iargc would return 3 as the value of the function call.
-
- SEE ALSO
- getopt(3C).
-
- NOTES
- The compiler expects the existence of a Fortran MAIN_ program when these
- functions are used.
-
- ORIGIN
- AT&T V.3
-
- Page 1 Release 4.0.1 August 1991
-
-
- GETARG(3F) Silicon Graphics GETARG(3F)
-
- NAME
- getarg, iargc - return Fortran command-line argument
-
- SYNOPSIS
- character*N c
- integer i, j
- integer function iargc
-
- call getarg(i, c)
- j = iargc()
-
- DESCRIPTION
- getarg returns the i-th command-line argument of the current process.
-
- iargc returns the index of the last argument.
-
- foo arg1 arg2 arg3
-
- getarg(2, c) would return the string ``arg2'' in the character variable
- c.
-
- iargc would return 3 as the value of the function call.
-
- SEE ALSO
- getopt(3C).
-
- NOTES
- The compiler expects the existence of a Fortran MAIN_ program when these
- functions are used.
-
- ORIGIN
- AT&T V.3
-
- Page 1 Release 4.0.1 August 1991
-
-
- --
- He who follows a path perpetuates that path.
- Practice random kindness and sensless acts of beauty.
-