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 

Calling an external program

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



Joined: 21 Jul 2007
Posts: 1

PostPosted: Mon Jul 23, 2007 9:12 pm    Post subject: Calling an external program Reply with quote

Hi:

I have an executable program (call it "Testing") created in Fortran (I don't have the fortran file, only the executable). I need to run "Testing" 1000 times, so I want to write a fortran code to do it with different inputs.

The ideas is that my code will read a series of inputs and then run the external executable "Testing" with these inputs. It will have to call the program, input the data to the program (which will produce some output files), and then go to the next set of inputs to rerun "testing"/

The inputs are really simple. I was advised that it is possible, but after browsing the user's guide for a while I still have no clue.

I would appreciate any help. Thank you.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Jul 24, 2007 8:10 am    Post subject: Reply with quote

The first thing to do is to work out how to run your program (testing) from a command line in a DOS box (command prompt window).

Then write a FTN95 program that calls START_PROCESS@ using a command line for just one run. Then you can extend your program to handle you 1000 runs.
Back to top
View user's profile Send private message AIM Address
davidsimmonds36



Joined: 18 Apr 2017
Posts: 2

PostPosted: Tue Apr 18, 2017 12:49 pm    Post subject: START_PROCESS@ Reply with quote

It seems that if I use START_PROCESS@ to run another Silverfrost FTN95 program, which terminates with CALL EXIT(errorcode), then the START_PROCESS@ function returns the value of errorcode to the original program. This is extremely useful, but doesn't seem to be documented (I found it by accident whilst trying to get the errorcode another way!). Is it an intentional and reliable feature? I very much hope it is...
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Apr 18, 2017 1:53 pm    Post subject: Reply with quote

Yes that is the way it is coded and there should be no reason to change it.
Back to top
View user's profile Send private message AIM Address
davidsimmonds36



Joined: 18 Apr 2017
Posts: 2

PostPosted: Tue Apr 18, 2017 1:58 pm    Post subject: Reply with quote

Thanks! Would be useful to mention this feature in the help system, it makes it very much easier to control one program from another.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Apr 18, 2017 2:14 pm    Post subject: Reply with quote

David,

If you want more sophisticated interaction between programs written in FTN95 you can pass messages between them.

There is a discussion in this thread:

http://forums.silverfrost.com/viewtopic.php?t=3222&highlight=message+passing

- and probably elsewhere, as message passing is one of my interests and I'm sure I posted more than once on the subject. EXIT error codes are one-way only, although restarting a program is trivial and usual quite fast.

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Apr 18, 2017 2:14 pm    Post subject: Reply with quote

OK. I will see what can be done.
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 -> Plato 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