Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getarg(3F) — Sun FORTRAN 1.3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

execve(2)

getenv(3F)

GETARG(3F)  —  FORTRAN LIBRARY ROUTINES

NAME

getarg, iargc − get the kth command line argument

SYNOPSIS

subroutine getarg ( k, arg )
character∗(∗) arg function iargc ()

DESCRIPTION

The statement call getarg( k , arg ) will get the kth command-line argument and put it into arg . 

The 0th argument is the command name. 

The function iargc returns the index of the last command-line argument,
and therefore the number of arguments after the command name.

EXAMPLE

demo% cat tesargs.f
character argv∗10
integer i, iargc, m
m = iargc()
i = 1
do while  ( i .le. m )
call getarg ( i, argv )
 write( ∗, ’( i2, 1x, a )’ ) i, argv
i = i + 1
end do
 stop
end
demo % a.out first second last
 1 first
 2 second
 3 last
demo%

FILES

/usr/lang/SC0.0/libF77.a

SEE ALSO

execve(2), getenv(3F)

Sun Release 4.1  —  Last change: 13 November 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026