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
 Origin Forum
 Running a program from ORIGIN 5 script

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
a_user Posted - 08/19/1998 : 3:06:00 PM
I have setup a script that runs a DOS program that does some
Calculations. The program generates an ASCII file that is read
be the script and plotted.
The problem I have, is when I use the run command to run the DOS
Program. The DOS program in lunched and the script continues to
run before the DOS program finished the calculation.
Is there any way to run a program and have the script wait until
the program stops.
1   L A T E S T    R E P L I E S    (Newest First)
Gary Lane Posted - 08/19/1998 : 3:08:00 PM
Execute a DOS program from a script and then wait until it terminates

It involves a few lines of code but there is a way to execute a DOS program
from a LabTalk script and then have the script wait until the DOS program
terminates before continuing with the next script command. First, you must
make a DOS batch file (DosProg.bat) that executes your DosProg.exe and
creates an Origin OGS file that sets a done flag equal to 1 after DosProg.exe
is done executing. For example, create a file named DosProg.bat that
contains the commands:

@echo off
echo [DoneYet] > C:\Origin50\Wait.ogs
echo done=0; >> C:\Origin50\Wait.ogs
start /w C:\Origin50\DosProg.exe
echo done=1; >> C:\Origin50\Wait.ogs
exit

Then, in your LabTalk script place the following lines of code:

// Insert into your script
done=0;
run -e C:\Origin50\DosProg.bat;
for( ;done==0; ) {
sec -p 0.5;
run.section(Wait,DoneYet);
};
// Continue with your script

The LabTalk script will idle in the for loop until your DOS program
terminates and the done flag is set to 1. Of course, you may need to alter
the file and path names in the above code to work with your system setup.


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