replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Fortran Code Help
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fortran Code Help

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Discodave



Joined: 18 Jun 2013
Posts: 1

PostPosted: Tue Jun 18, 2013 1:18 pm    Post subject: Fortran Code Help Reply with quote

Ok a big sorry I am very new to Fortran, but have been coding in C for many years.

I have some very old code that I am looking at (complied in Ftn95/Plato IDE). The code now complies fine, but when executed the code crashes on trying to open a file. The executable is launched from a batch file, eg:-

Test.bat (contains)

c:\code\Test.exe C:\data\data.dat

the executable launches from the command line and requires to read in the data file. However the code opens the file like this:-

OPEN(5, '')

Currently unsure how this data file path is being retrieved and unsure why it is trying to open the file without a string being present.

I have replaced the OPEN command with

OPEN(5, 'C:\data\data.dat')

and all works fine, but I do need the ability to read the path from the batch file. Any pointer would be great Very Happy

Thanks for all your help Very Happy
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Tue Jun 18, 2013 5:21 pm    Post subject: Reply with quote

Try using the standard routine GET_COMMAND_ARGUMENT.
You will find it in the FTN95 help file.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group