home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / fortran / 3080 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  2.7 KB

  1. Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!mips!darwin.sura.net!jvnc.net!rutgers!concert!borg!debussy!taylorr
  2. From: taylorr@debussy.cs.unc.edu (Russell Taylor)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: Unix ARGC,ARGV in Fortran 77
  5. Message-ID: <14549@borg.cs.unc.edu>
  6. Date: 18 Aug 92 12:26:39 GMT
  7. References: <14542@borg.cs.unc.edu>
  8. Sender: news@cs.unc.edu
  9. Organization: The University of North Carolina at Chapel Hill
  10. Lines: 92
  11.  
  12. In article <14542@borg.cs.unc.edu> marshall@marshall.cs.unc.edu (Jonathan A. Marshall) writes:
  13. >I need to write a Fortran program that will accept command-line arguments.
  14. >I'm running Ultrix f77 on a DECstation 5000.  In C, command-line arguments
  15. >can be passed with argc and argv.
  16. >
  17. >How is this done in f77?  There's got to be a way, right?
  18. >
  19.     "man -k arg" on tyrosine reveals:
  20. getarg, iargc (3F)      - return Fortran command-line argument
  21.     On the decstation there are no such man pages, so here are the
  22. tyrosine versions.  Note that tyrosine (iris) is a System V unix, so
  23. who knows if they are the same?
  24.  
  25. GETARG(3F)                     Silicon Graphics                     GETARG(3F)
  26.  
  27. NAME
  28.      getarg, iargc - return Fortran command-line argument
  29.  
  30. SYNOPSIS
  31.      character*N c
  32.      integer i, j
  33.      integer function iargc
  34.  
  35.      call getarg(i, c)
  36.      j = iargc()
  37.  
  38. DESCRIPTION
  39.      getarg returns the i-th command-line argument of the current process.
  40.  
  41.      iargc returns the index of the last argument.
  42.  
  43.           foo arg1 arg2 arg3
  44.  
  45.      getarg(2, c) would return the string ``arg2'' in the character variable
  46.      c.
  47.  
  48.      iargc would return 3 as the value of the function call.
  49.  
  50. SEE ALSO
  51.      getopt(3C).
  52.  
  53. NOTES
  54.      The compiler expects the existence of a Fortran MAIN_ program when these
  55.      functions are used.
  56.  
  57. ORIGIN
  58.      AT&T V.3
  59.  
  60. Page 1                          Release 4.0.1                      August 1991
  61.  
  62.  
  63. GETARG(3F)                     Silicon Graphics                     GETARG(3F)
  64.  
  65. NAME
  66.      getarg, iargc - return Fortran command-line argument
  67.  
  68. SYNOPSIS
  69.      character*N c
  70.      integer i, j
  71.      integer function iargc
  72.  
  73.      call getarg(i, c)
  74.      j = iargc()
  75.  
  76. DESCRIPTION
  77.      getarg returns the i-th command-line argument of the current process.
  78.  
  79.      iargc returns the index of the last argument.
  80.  
  81.           foo arg1 arg2 arg3
  82.  
  83.      getarg(2, c) would return the string ``arg2'' in the character variable
  84.      c.
  85.  
  86.      iargc would return 3 as the value of the function call.
  87.  
  88. SEE ALSO
  89.      getopt(3C).
  90.  
  91. NOTES
  92.      The compiler expects the existence of a Fortran MAIN_ program when these
  93.      functions are used.
  94.  
  95. ORIGIN
  96.      AT&T V.3
  97.  
  98. Page 1                          Release 4.0.1                      August 1991
  99.  
  100.  
  101. -- 
  102. He who follows a path perpetuates that path.
  103. Practice random kindness and sensless acts of beauty.
  104.