.\" @(#)getarg.3f 1.3 86/01/02 SMI; from UCB 4.2 .TH GETARG 3F "07 July 1995" .SH NAME getarg, iargc \- get the k\fIth\fP command-line argument .SH SYNOPSIS .\" .IX getarg "" \fLgetarg\fP .IX iargc "" \fLiargc\fP .IX "command line argument" .IX arguments "of command line" .\" .B subroutine getarg ( k, arg ) .br .B character*(*) arg .sp .2 .B function iargc () .\" .SH DESCRIPTION .\" The statement .B "call getarg( k , arg )" gets the .BI k th command-line argument and puts it into .BR arg . .PP The .BI 0 th argument is the command name. .PP The function .B iargc returns the argument count, which is the index of the last command-line argument. .\" .SH EXAMPLE .nf .ft 3 demo% cat tesargs.f character argv*10 integer i, iargc, m m = iargc() do i = 1, m call getarg ( i, argv ) write( *, '( i2, 1x, a )' ) i, argv end do end demo % a.out first second last 1 first 2 second 3 last demo% .ft 1 .fi .SH FILES .B libF77.a .SH "SEE ALSO" .BR execve (2), .BR getenv (3F)