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
 Getting the number of workbooks ina project
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

thentangler

USA
Posts

Posted - 10/05/2012 :  2:53:41 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi all,
Can somebody point out to me the labtalk script for obtaining the number pf workbooks in a particular project?
Thank You

Origin Ver8.0 and Service Release (Select Help-->About Origin):
Operating System:

thentangler

USA
Posts

Posted - 10/05/2012 :  3:14:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am actually trying to perform statistics on the columns of each worksheet in each workbook in my Originfile.
Is there a way to make each worksheet active and then to the statistics, and move on the to the next worksheet and so on?
I can get the number of worksheets using page.nLayers, but how do I incorporate them in a for loop to perform my calculations?

Sorry I tried editing the topic but it did not allow me.
Thanks in advance for the help
Go to Top of Page

greg

USA
1378 Posts

Posted - 10/08/2012 :  08:51:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
here is the basic setup for looping over all workbooks in a project, all worksheets (layers) in each workbook and all columns in each worksheet:

// for each workbook
doc -e w
{
// next workbook is temporarily active
loop(ii,1,page.nlayers)
{
// make next worksheet active
page.active = ii;
// for each column
loop(jj,1,wks.ncols)
{
stats $(jj);
ty mean of sheet [%h]%(layer.name$), column %(wks.col$(jj).name$) is $(stats.mean);
}
}
}

type stats.= in script or command window to see all stats values that are calculated.
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