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 cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing arguments to fortran exec

Status
Not open for further replies.

Feddozz

Mechanical
Joined
Dec 15, 2005
Messages
16
Location
GB
Hello,
my executables read input files, calculate and write output files.
I would like to pass the name of the input file as an argument on the command line environment.
I.e.:
c:\>Myprogram c:\input_file.txt

Is it possible with FORTRAN?

Thanks in advance!
Vince
 
Why wouldn't it be?

TTFN

FAQ731-376
 
Vince - the following are now part of the fortran standard:-

command_argument_count()
call get_command_argument
call get_command


for example:-

Code:
      if (command_argument_count().gt.0) call get_command_argument(1,file,length,ierr)




 
It works perfectly,
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top