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

ungat

Belgium
Posts

Posted - 11/17/2005 :  12:25:28 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: Wondows XP

Hello,

1) Is it possible to create several Custom Routine buttons? because I have several script which I have to use more than once.

2)Is it possible that a script submit an other script after its execution ? All scripts are located in the same directory.
Could you give me an example please ?

3)I have a worksheet with 2 columns and I would like to create a third column and put in a numerical value; for example
wks.addCol();
Data1_C = 1;

but Data1_C = 1; doesn't work, I can't put a numerical value in the column

whereas Data1_C = Data1_B * 2 is OK

could you help me please ?

Thank you very much.

Mike Buess

USA
3037 Posts

Posted - 11/17/2005 :  12:58:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This article should help with your first two questions...
http://www.originlab.com/index.aspx?s=9&pid=416

3) Try this...

wks.addCol();
Data1_C = Data1_B; // fill col C with values
Data1_C = 1; // set all values to 1

Mike Buess
Origin WebRing Member
Go to Top of Page

ungat

Belgium
Posts

Posted - 11/17/2005 :  1:22:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:

This article should help with your first two questions...
http://www.originlab.com/index.aspx?s=9&pid=416

3) Try this...

wks.addCol();
Data1_C = Data1_B; // fill col C with values
Data1_C = 1; // set all values to 1

Mike Buess
Origin WebRing Member



Ok, thank you very much,

I have took a look at this article, but I have not found anything about a script which submit an other script and about creating many Custom Routine buttons.

Thank you again.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/17/2005 :  2:00:09 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
One script can be called from another with the run.section() method as explained on Page 2. Custom Toolbar buttons are explained on Page 6.

Mike Buess
Origin WebRing Member
Go to Top of Page

fzimnoch

USA
28 Posts

Posted - 11/18/2005 :  3:48:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi:

If you include the decimal point in the // set all values to 1 statement it works fine. For example:

Data1_C = 1.0; // set all values to 1

FRED
Go to Top of Page

ungat

Belgium
Posts

Posted - 11/19/2005 :  4:02:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello, thank you for your help,

how do you "Tile Vertically" or "Tile Horizontally" in script wondow ?

Thank you again.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/19/2005 :  10:44:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
menu -e 57651; // execute Tile Horizontally menu command
menu -e 57652; // execute Tile Vertically menu command

Mike Buess
Origin WebRing Member
Go to Top of Page

ungat

Belgium
Posts

Posted - 11/21/2005 :  06:34:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Mike, excuse me for disturbing you again,

How do you calculate area of a curve y=f(x) between x1=R1 and x2=R2?

I have a data called "Aij" with two columns A(X) and B(Y); I would like to calculate area A1 between x1=0 and x2=R1 , area A2 between x1=0 and x2=R2 and area A3 between x1=0 and x2=R3. And I would like to put the results A1,A2 and A3 in a third column C(Y) of data "Aij".

Thank you very much.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/21/2005 :  08:22:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use the integrate command...

win -a Aij; // activate wks
i0=xindex(0,col(B)); // row index for X=0
i1=xindex(R1,col(B)); // row index for X=R1
i2=xindex(R2,col(B)); // row index for X=R2
i3=xindex(R3,col(B)); // row index for X=R3
if( wks.ncols<3 ) wks.addCol(); // add 3rd col if necessary
integrate col(B) -b i0 -e i1;
cell(1,3)=integ.area;
integrate col(B) -b i0 -e i2;
cell(2,3)=integ.area;
integrate col(B) -b i0 -e i3;
cell(3,3)=integ.area;

Mike Buess
Origin WebRing Member
Go to Top of Page

ungat

Belgium
Posts

Posted - 11/21/2005 :  4:23:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much Mike;

I have another question:

I would like do this stuff:

%Z=Aaw002M Aaw005M Aaw007M;
%A=%[%Z,#1];
%N=%[%Z,#2];
%P=%[%Z,#3];
win -t D;
wks.addCol();
win -r %H Aaw;
win -a Aaw;
cell(1,1)=0,02;
copy %A_M %H_B;
copy %A_s %H_C;
copy %N_M %H_B;
copy %N_s %H_C;
copy %P_M %H_B;
copy %P_s %H_C;
cell(2,1)=0,05;
cell(3,1)=0,07;

but I want copy only first line of each column; it means:

copy first line of %A_M to first line of %H_B
copy first line of %A_s to first line of %H_C
copy first line of %N_M to second line of %H_B
copy first line of %N_s to second line of %H_C
copy first line of %P_M to third line of %H_B
copy first line of %P_s to third line of %H_C

and so ...

Thank you very much.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/21/2005 :  5:27:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use dataset2[ii] = dataset1[jj] to copy single values...

%H_B[1] = %M_M[1]; // copy first line of %A_M to first line of %H_B
%H_C[1] = %M_s[1]; // copy first line of %A_s to first line of %H_C
%H_B[2] = %N_M[1]; // copy first line of %N_M to second line of %H_B
%H_C[2] = %N_s[1]; // copy first line of %N_s to second line of %H_C
%H_B[3] = %P_M[1]; // copy first line of %P_M to third line of %H_B
%H_C[3] = %P_s[1]; // copy first line of %P_s to third line of %H_C

Mike Buess
Origin WebRing Member
Go to Top of Page

ungat

Belgium
Posts

Posted - 11/29/2005 :  1:06:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

I would like import a data which name has more than 13 letters (character) with script window; but it doesn't work.

Thank you for your help.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/29/2005 :  2:18:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The name of a worksheet, graph or matrix window can have no more than 13 characters. One workaround is to put the long string in the page label which has fewer length and character restrictions...

%A="This is a very long string";
page.label$=%A; // create page label
page.title=3; // show page label

Mike Buess
Origin WebRing Member
Go to Top of Page

ungat

Belgium
Posts

Posted - 11/29/2005 :  2:50:46 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok, thank you,

but why "page.title=3;" ? why 3 ?

I have another problem:
I have a worksheet which name is unknown; I would like determin his name with script window so:

%A="name of actif worksheet" is it possible ?

Thank you again.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/29/2005 :  3:39:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
page.title=0 or 2; // show name only
page.title=1; // show label only
page.title=3; // show name and label

The string variable %H always holds the name of the active window...

%A=%H; // save name of active window as %A

Mike Buess
Origin WebRing Member
Go to Top of Page

ungat

Belgium
Posts

Posted - 12/01/2005 :  07:37:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

This minimize all worksheets and arrange icons:

doc -e W {win -i};
menu -e 57649;

but how do you minimize all Graphs ?

Thank you very much.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 12/01/2005 :  08:06:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
doc -e P {win -i}; // minimize all graph windows
- or -
doc -e O {win -i}; // minimize all windows


Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 12/01/2005 09:43:09 AM
Go to Top of Page

ungat

Belgium
Posts

Posted - 12/01/2005 :  12:40:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok, thank you;

how do you calculate FFT of a column with sript ?

Thank you.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 12/01/2005 :  1:12:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There is an example in the Programming Guide...

Help > Programming > LabTalk Language Reference > Object Reference > Alphabetical Listing > FFT > Fast Fourier Transforms

You'll also find many examples in the forum by searching for FFT.

Mike Buess
Origin WebRing Member
Go to Top of Page

ungat

Belgium
Posts

Posted - 12/06/2005 :  07:29:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello, excuse me again,

I would like to Set As Y Error column N x of a data, in script window; could you help me please ?

Thank you very much.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 12/06/2005 :  08:21:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
wks.col$(i).type = 3; // where i is the column number...

Help > Programming > LabTalk Language Reference > Object Reference > Alphabetical Listing > Wks.Col

Mike Buess
Origin WebRing Member
Go to Top of Page

ungat

Belgium
Posts

Posted - 12/06/2005 :  11:09:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok thank you very much,

I found the answer in Help > Programming > LabTalk Language Reference > Object Reference > Alphabetical Listing;

but I have another problem; I would like to plot layers with Horizontal Scale from a to b and Vertical Scale from c to d;

I didn't find answer in Help.

Thank you for you help.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 12/06/2005 :  1:07:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Use the Layer.Axis object...

layer1.x.from=a;
layer1.x.to=b;
layer1.y.from=c;
layer1.y.to=d;

If layer 1 is active you can also use this...

x1=a;
x2=b;
y1=c;
y2=d;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 12/06/2005 1:09:24 PM
Go to Top of Page

ungat

Belgium
Posts

Posted - 12/07/2005 :  2:29:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
layer1.x.from=a;
layer1.x.to=b;
layer1.y.from=c;
layer1.y.to=d;

If layer 1 is active you can also use this...

x1=a;
x2=b;
y1=c;
y2=d;


Hello Mike, thank you very much;

in my case, the layer has a name; I have to replace layer1 by layer name ?

And how do you precise the axis increment ?

Thank you.

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 12/07/2005 :  3:55:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Tick increment is layer.axis.inc. There is no convenient way to access a layer by name. However, you can determine the layer number from its name like this...

%L=layerName;
// now loop through all layers to find which one is named layerName
nn=0;
loop (ii,1,page.nlayers) {
%A=layer$(ii).name$;
if("%L"=="%A") {nn=ii; break};
};
if(nn>0) {
layer$(nn).x.from=a;
layer$(nn).x.to=b;
layer$(nn).x.inc=z;
};

Mike Buess
Origin WebRing Member
Go to Top of Page

ungat

Belgium
Posts

Posted - 12/07/2005 :  4:12:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok thank you,

but is there a way to precise axis increment for an active layer ?

thank you.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 12/07/2005 :  4:25:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I don't understand the question. The only increment that is associated with a layer is the tick increment. The data increment (distance between data points) is determined by the X column.

Mike Buess
Origin WebRing Member
Go to Top of Page

ungat

Belgium
Posts

Posted - 12/07/2005 :  4:40:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It's ok, excuse me.

Thank you.
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