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
 HOWTO: 'Set Column Values' from other 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

brendanarnold

Ireland
Posts

Posted - 05/29/2008 :  12:51:53 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version 8 SR1
Operating System: Windows XP

The new notation (i.e. [BookName]SheetName!Col(ColRef) )for referring to columns in another workbook does not seem to work in the 'Set Column Dialogue' for Origin 8 SR1. In order to work around this, expand the 'Before Formula Scripts' box in the dialogue and enter

range varname = [BookName]SheetName!Col(ColRef)


And then enter 'varname' in the main 'Set Column Dialogue' text field. make sure 'varname' does not clash with an already declared variable name in Origin by typing 'list a' in the main code window.

Regards,

Brendan Arnold

easwar

USA
1965 Posts

Posted - 05/30/2008 :  5:21:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Brendan,

Yes, the "Before Formula Script" panel can be used to run any script prior to computing the formula, and such script can include definition of range variables and other variables as well.

BUT, if you explicitly define a variable in that panel, such as your range definition, the scope of that variable is only within that panel and it does not clash with global variables.

That is how it is supposed to work, and how it works, when we test. Do you see otherwise?

For example, if you have a global varible
aa=10
and in the before formula script you declare
double aa=20;
thus explicitly declaring a double aa variable, then the aa inside the panel is a different variable from the global aa variable, and can have a different value.

You can check by putting "list a;" or other commands such as "aa=;" etc inside that panel to dump the values.

Easwar
OriginLab

[/quote]

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