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
 Origin Forum
 Script execution problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

aminikin

Germany
2 Posts

Posted - 10/31/2000 :  12:50:21 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
The following problem occurs with Origin 6.0 on my Windows NT 4 system:

A script which performs as it should if started from within the script window does not execute correctly, if started via the menu (run command). Some commands seem to be ignored. For example the following simplified sequence:

if (exist(SomeGraph)==2) win -active SomeGraph;
layer -s 1;
set data_a -b 1;
set data_a -e 10;
layer -s 2;
set data_a -b 11;
set data_a -e 20;

So what I am trying to get is that in two different layers two different portions (ranges) of the data are being plotted.

However, if the script is executed by the run command, the activation of certain layers is obviously ignored, because in all layers the range would be set as chosen for the last layer (11..20 in this case).

This behaviour does not occur with the same script executed from the script window.

This drives me crazy! Is this a bug or do I misunderstand something???

Thanks for any help. Andreas

cpyang

USA
1406 Posts

Posted - 10/31/2000 :  7:06:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
First, you should use ogs file. To run script from a file with the run command was only for cnf files that initilize parameters in old versions. Newer versions we recommand using ogs file. For example, put your script into the custom.ogs file and run it from the
"Custom Routine" button on the standard toolbar.

The problem with your script is the layer -s command is not reliable when a window is activated, so we always recommand using layer -o and win -o commands. You should write your script into an ogs file as follows:

in Custom.ogs, for example

[Main]
if (exist(SomeGraph)==2) win -active SomeGraph;

layer -o 1 {set data_a -b 1;set data_a -e 10};
layer -o 2 {set data_a -b 10;set data_a -e 20};

I should have used win -o SomeGraph above, but using only one activation would be fine, just not two together that would have timing problem.



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