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 HELP

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
rezapaz Posted - 05/06/2008 : 1:23:32 PM
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
2   L A T E S T    R E P L I E S    (Newest First)
rezapaz Posted - 05/07/2008 : 11:13:35 AM
thank you very much for your help
greg Posted - 05/07/2008 : 10:33:54 AM
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.


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