Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to use an equivalent of argv, argc in fortran?

Status
Not open for further replies.

fishytiger

Technical User
Jan 11, 2005
8
CA
I am using fortran 95, and was wondering if this is implemented . . .


thanks

fishytiger
 
Depends on which implementation you are using. On G95 (taken from the G77 manual), it has

10.11.9.133 IArgC Intrinsic

IArgC()

IArgC: INTEGER(KIND=1) function.

Intrinsic groups: unix.

Description:

Returns the number of command-line arguments.

This count does not include the specification of the program name itself.

10.11.9.118 GetArg Intrinsic

CALL GetArg(Pos, Value)

Pos: INTEGER; scalar; INTENT(IN).

Value: CHARACTER; scalar; INTENT(OUT).

Intrinsic groups: unix.

Description:

Sets Value to the Pos-th command-line argument (or to all blanks if there are fewer than Value command-line arguments); CALL GETARG(0, value) sets value to the name of the program (on systems that support this feature).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top