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

rezapaz

Germany
Posts

Posted - 05/06/2008 :  1:23:32 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: Vista

Hi,

I am unsing Origin now for a while, and now I need some scripting. I have the following problem: I have several Worksheets and column A of some of them should be added with 3600 and so on. How can I do that with a script? and is there a good tutorial how to learn wrting scripts?

Thanks a lot

Reza

greg

USA
1379 Posts

Posted - 05/07/2008 :  10:33:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Here is a script that asks for the magic number, then loops through all the worksheets and when it finds one with a column named 'A' asks if you want to add the magic number to it.
// BEGIN SCRIPT
getn (Value to add) val (Column A Adder);
doc -e W {
if(exist(%H_A)) {
sum(%H_A);
getyesno (Add to %H_A? [$(sum.min)..$(sum.max)) resp;
if(resp) %H_A+=val;
}
}
// END SCRIPT

getn (Value to add) val (Column A Adder);
prompts you for a value. Could replace with
val=3600;

doc -e W {
..
}
handles looping through all Worksheets.

if(exists(%H_A)) {
..
}
makes sure we only look at worksheets with a column 'A'.

sum(%H_A);
gathers some statistics to help you decide.

getyesno (Add to %H_A? [$(sum.min)..$(sum.max)) resp;
asks if adding should occur (and gives you a min and max value).

if(resp) %H_A+=val;
does the job if you clicked Yes.

Going through the 'Overview of the LabTalk Language' book in the Programming Help : LabTalk Language Reference might be useful.

Go to Top of Page

rezapaz

Germany
Posts

Posted - 05/07/2008 :  11:13:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thank you very much for your help
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