| 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 |