The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Run a fortran code from Origin

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
DrDanon Posted - 06/11/2004 : 4:30:05 PM
I created a button that can run a Fortran code using the run -e command. The code Opens a dos box and runs. The output of the code( a file) is loaded to a worksheet. The problem is a need some way knowing that the Fortran code finished and only then run the open command to load the file. Any ideas??


Yaron
2   L A T E S T    R E P L I E S    (Newest First)
perger Posted - 07/15/2004 : 05:13:23 AM
The method mentioned by Mike is not flawless:
If the fortran code runs for a long time and continuously writes into the output file, then the import occurs when the file is created and not when it is closed. Therefore, the imported dataset contains only the first few lines of the output.
One possible solution is to create a "flag file" (e.g. finished.txt) from the fortran code before it exits, and checking the existance of this "flag file" from the LabTalk script.

Tamas Perger
Mike Buess Posted - 06/12/2004 : 12:07:26 PM
Hi Yaron,

Apparently you know the name of the output file in advance so you can write a script that simply waits until the file appears...

%Z=file path\name;
run -e Fortran program;
for(i=1;i>0;) {
sec -p 0.1; // pause 0.1 seconds
if(exist(%Z)>0) break; // continue if file exists
};
open -w %Z;

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000