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
 Chaining mathtool commands
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ScriptQuestions

Germany
4 Posts

Posted - 03/02/2022 :  04:36:40 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello.

I am currently trying to execute a script made in the Code Builder similar to this:


mathtool -r 2 iy1:=[Book1]"Sheet1"!(A"Temperature",F"Value") operator:=sub iy2:=[Book2]"Sheet1"!(A"Temperature",I"DifferentValue1") oy:=[Book1]"Sheet1"!(A"Temperature",G"FirstResult");

//these are options that i tried to achieve my goal, but did not work so far.
run -auf 1 0;
doc -uw;
second -poc 3;
save;

mathtool -r 2 iy1:=[Book1]"Sheet1"!(A"Temperature",H"FirstResultAltered") iy2:=[Book2]"Sheet1"!(A"Temperature",I"DifferentValue2") oy:=[Book1]"Sheet1"!(A"Temperature",M"FinalResult");


This is a simplified version of my script. The difference between FirstResult and FirstResultAltered is that the content of FirstResultAltered is gained by a formula dependent on the column FirstResult.
For example, Col("FirstResultAltered")[O]$= Col("FirstResult")^2.

My current problem is that the script finishes before recalculation was done, resulting in the second mathtool operation to put out empty lines filled with "--".

I tried running the script both with run ScriptName.ogs, and run.file(Scriptname.ogs), but in both cases it does the same thing.

So my question is: How do I make the script wait for recalculation to finish before performing a second mathtool operation?

ScriptQuestions

Germany
4 Posts

Posted - 03/02/2022 :  05:21:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Found the solution:

run -p au;

before the second calculation causes the program to wait for recalculation.
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