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 for Programming
 LabTalk Forum
 repeat script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

CHE-TR01

UK
Posts

Posted - 03/13/2006 :  2:07:19 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: XP

I have the following script which carries out various changes to my particular worksheet. I've had a look through the forums and help menus but am still struggling with the following simple questions:

Firstly, how do I carry out the initial sort function on the active worksheet as opposed to having to name it each time?

Secondly, I have imported roughly 200 worksheets on which I want to apply the script. The difficulty I am having is putting in a loop command so that I do not have to carry it out one at a time.

The script is as follows:


sort.wksname$ = test1;
sort.c1 = 0; // all columns
sort.r1 = 1; // from row 1 to
sort.r2 = 1314; // row 1314,
sort.cname1$ = A: A;
// using column A as the primary, sort in ascending order
sort.wks(); // execute sort;

mark -d col(A) -b 1315 -e 1315;
mark -d col(A) -b 2 -e 1169;

del col(B);
del col(E);
del col(F);

worksheet -a 1; // Add 1 columns to the active worksheet

col(B)=ln(col(C)/col(D)); // Take natural log

Any help would be greatly appreciated,

Thanks,

Richard

Laurie

USA
404 Posts

Posted - 03/13/2006 :  2:32:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
%H is a system string variable that returns the name of the active window, so you can use that in place of "test1".

The document command can be used to loop through all worksheet windows. You can then put your script inside the doc -e W { } command.

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