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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Problem with script execution
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ibvmt

Switzerland
Posts

Posted - 06/09/2005 :  08:03:00 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5 sr5
Operating System: Win XP pro
Hello
I have problems with script execution.
I put calculation steps on user buttons.
Each button runs a script (run.file cmd).
This works fine.
Now I have a button to run all calculations (several run.file cmds).
The first script imports an ASCII file.
The second script starts already, when the progress bar stays at 99%.
So I don't get the desired results, because the data isn't there yet.
Any suggestions?
Thanks
Peter

Mike Buess

USA
3037 Posts

Posted - 06/09/2005 :  10:27:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Peter,

You can avoid most, probably all, of those problems by launching your button scripts with run.section rather than run.file.

1. Launch CodeBuilder and select File > New.
2. In New File dialog select LabTalk Script File.
3. Enter a file name and enter the same Location you currently use for your script files.
4. Click OK to create and open the file.
5. Edit the file to look something like this...

[Button1]
// Paste your scripts for the first button here

[Button2]
// Paste scripts for second button

// Add similar sections for all except the Run All button.
// That section should look like this...

[RunAll]
run.section(,Button1);
run.section(,Button2);
// etc.

Now change your button settings (View > Toolbars > Button Groups) as follows...

Button 1 settings:
File Name: enter path\name selected in Step 3 above
Section Name: Button1

Button 2 settings:
File Name: same as Button 1
Section Name: Button2

Run All settings:
File Name: same
Section Name: RunAll

Your scripts will perform better and also be easier to maintain when organized in that fashion.

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000