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
 Loop using Doc -e D
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bjornh

Sweden
6 Posts

Posted - 05/03/2001 :  01:11:16 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I'm trying to perform some calculations on all datasets in my graph by looping each layer with page.active=ii and then use the doc -e D command for setting start and end for the calculation. Does anybody have any useful suggestions how I can get this to work?

Regards, Bjorn
--------------------------------
doc -cl;
loop(ii,1,count)
{
page.active=ii;
doc -e D
{
set %C -bs MkS1;
set %C -es MkS2;
sum(%C);
};
};
//end

Lorraine

USA
66 Posts

Posted - 05/04/2001 :  4:10:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello.. here's an example of a script that loops through each dataset in all layers. This example sets a range from 10-20 (just as an example) and does the calculation just within that range. As it loops through it finds the min and max value of each dataset within this range. This may not be exactly what you're after but your above script does hint for setting a range (MkS1,MkS2) and using the sum function. The below example illustrates reporting the min/max values (again just as an example) based on the sum function to the script window. I hope this helps.


from=10;
to=20;
doc -cl;
loop(ii,1,count)
{
page.active=ii;
doc -e D
{
MkS1=from;
MkS2=to;
sum(%C);
a=sum.max;
b=sum.min;
type max value for %C is $(a);
type min value for %C is $(b);
};
};
//end


Lorraine
OriginLab Technical Support
Go to Top of Page

bjornh

Sweden
6 Posts

Posted - 05/08/2001 :  01:44:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Lorraine,

thanks for Your help. My problem seem to be that I cant get the doc-loop to work, I´ve tried copy/insert of Your script, but even that doesn´t help! Nothing inside the doc-command seem to be executed, not even a simple type-command as a first line. If I exclude the doc-loop everything works fine, I get the statistics but of course only for one plot in each layer. Are there any more "debugging"-tests that I can do or could You suggest any alternative way to call all plots in a graph window?
I´m using Origin 6.1

Regards, Bjorn


Go to Top of Page

bjornh

Sweden
6 Posts

Posted - 05/09/2001 :  04:14:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello again Lorraine,

my problems are solved and Your script works very well, thank You!

By the way, do You know of any way to open an already existing
notes window and add new text to the end of (much like in the result log case)?

Regards
Go to Top of Page

Lorraine

USA
66 Posts

Posted - 05/10/2001 :  2:43:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Bjorn,
Here are several script examples to illustrate different methods of writing to a Notes window.

This script example creates a new Notes window from scratch and adds text:


ii=type.redirection;
win -n notes;
%A=system.notes.created$;
type.notes$=%A;
type.redirection=2;
type "text in the Notes Window";
type.redirection=ii;


Here's a script that activates then writes to an already existing Notes window (provided you know the name of the window):


ii=type.redirection;
win -in Notes1;
win -an Notes1;
type.redirection=2;
type "MORE TEXT";
type.redirection=ii;


Here's another twist, you can use the get command to get text to then write to the Notes window:

ii=type.redirection;
win -in Notes;
win -an Notes;
type.redirection=2;
getstring (enter text here) text hello;
type %b;
type.redirection=ii;


Or you can use another method to store information to a numerical and/or string variable that can get written to the Notes window:

value=3*10;
ii=type.redirection;
win -in Notes;
win -an Notes;
type.redirection=2;
type $(value);
type.redirection=ii;



Lorraine
OriginLab Technical Support
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