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
 Forum for Origin C
 Dialog box selecting workbooks?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

vlada.jerkovic

Germany
8 Posts

Posted - 12/09/2008 :  4:56:58 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.8 and SR3 (Select Help-->About Origin):
Operating System:win XP

Is it possible to open some dialog box to select several workbooks from within origins project explorer in order to perform specific operation on them (like averaging, subtractions, etc. )? Please some example in C.

Iris_Bai

China
Posts

Posted - 12/10/2008 :  02:40:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can use XF builder to create a X-Function dialog with specified worksheet number. The dialog just like the picture below:


About how to create this dialog, you can:
1. Choose menu Tools -> X-Funcitons Builder, in opening dialog, type "averaging" as xf name in X-Function editbox.
2. In Variables table, right click and choose Add variable, then do the following changes:
Name DataType
wks1 Worksheet
wks2 Worksheet
3. Choose menu File -> Save, in opening Save dialog, click Save button.
4. Click Edit X-Funciton in Code Builder button, in Code Builder averaging function, copy the statement below in funciton body:
printf("wks1 is %s, wks2 is %s\n", wks1.GetName(), wks2.GetName());
and click Compile button , and click Return to Dialog button back to X-Function builder
5.In X-Function builder, click Save button to save code change, close X-Function builder.
6. In Command window, run "averaging -d", a dialog show, you can click active button to choose worksheet.

But, do you want to select data from several workbook, not workbook? If so, can set DataType to vector, Range or XYRange and so on. More information about how to create new X-Funciton, like refer to http://www.originlab.com/www/helponline/Origin8/en/Programming/mergedProjects/XFProgramming/XFProgramming/Create_New_X-Function.html

Iris
Go to Top of Page

vlada.jerkovic

Germany
8 Posts

Posted - 12/15/2008 :  2:45:46 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for your answer. I did a similar X-Function for matrix selection. However, I would like to ask is it possible to make such a function where user could choose the number of matrix windows he/she would like to select from the project, where this number would vary depending on the task.
This would be equivalent to selecting a number of matrices/worksheets in wks1 input variable from the example you provided, and one matrix/worksheet as wks2 in order to perform a specific operation between each matrix from the wks1 group and the one selected in wks2.

The problem is that the number of matrices/worksheets in the wks1 group is not constant, so the number of input variables for this X-function would vary.

Thanks in advance.
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