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
 All Forums
 Origin Forum
 Origin Forum
 Script window

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ungat Posted - 11/17/2005 : 12:25:28 PM
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.

27   L A T E S T    R E P L I E S    (Newest First)
ungat Posted - 12/07/2005 : 4:40:15 PM
It's ok, excuse me.

Thank you.
Mike Buess Posted - 12/07/2005 : 4:25:21 PM
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
ungat Posted - 12/07/2005 : 4:12:40 PM
Ok thank you,

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

thank you.
Mike Buess Posted - 12/07/2005 : 3:55:47 PM
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
ungat Posted - 12/07/2005 : 2:29:38 PM
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.

Mike Buess Posted - 12/06/2005 : 1:07:33 PM
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
ungat Posted - 12/06/2005 : 11:09:15 AM
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.
Mike Buess Posted - 12/06/2005 : 08:21:33 AM
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
ungat Posted - 12/06/2005 : 07:29:04 AM
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.
Mike Buess Posted - 12/01/2005 : 1:12:43 PM
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
ungat Posted - 12/01/2005 : 12:40:19 PM
Ok, thank you;

how do you calculate FFT of a column with sript ?

Thank you.
Mike Buess Posted - 12/01/2005 : 08:06:07 AM
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
ungat Posted - 12/01/2005 : 07:37:46 AM
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.
Mike Buess Posted - 11/29/2005 : 3:39:40 PM
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
ungat Posted - 11/29/2005 : 2:50:46 PM
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.
Mike Buess Posted - 11/29/2005 : 2:18:06 PM
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
ungat Posted - 11/29/2005 : 1:06:40 PM
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.
Mike Buess Posted - 11/21/2005 : 5:27:12 PM
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
ungat Posted - 11/21/2005 : 4:23:43 PM
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.
Mike Buess Posted - 11/21/2005 : 08:22:36 AM
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
ungat Posted - 11/21/2005 : 06:34:57 AM
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.
Mike Buess Posted - 11/19/2005 : 10:44:38 PM
menu -e 57651; // execute Tile Horizontally menu command
menu -e 57652; // execute Tile Vertically menu command

Mike Buess
Origin WebRing Member
ungat Posted - 11/19/2005 : 4:02:16 PM
Hello, thank you for your help,

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

Thank you again.
fzimnoch Posted - 11/18/2005 : 3:48:28 PM
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
Mike Buess Posted - 11/17/2005 : 2:00:09 PM
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
ungat Posted - 11/17/2005 : 1:22:51 PM
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.
Mike Buess Posted - 11/17/2005 : 12:58:05 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000