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
 A bug in Set Column Values?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

redman

UK
59 Posts

Posted - 10/08/2018 :  05:31:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2018b 64bit
Operating System: windows 10

Hello, It is nice to notice that A, B, C instead of col(a), col(2), col(3)...can be used when setting the column values. It was claimed that when moving the position of the relative columns, the formula will change automatically to maintain the correct calculation. However, there may be a problem if there are any scripts set in "before formula scripts".

For example: if we execute the following scripts in the script window first, and then move the second column to the last position. Now, the formula in second column becomes "2*D" immediately, however, the formula in the third column remains "2*B".

{
wks.ncols=4;
csetvalue col:=col(C) formula:="2*B" recalculate:=1;
csetvalue col:=col(D) formula:="2*B" script:="2*3=" recalculate:=1;
}

Edited by - redman on 10/10/2018 05:35:54 AM

yuki_wu

896 Posts

Posted - 10/09/2018 :  02:31:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I am sorry that this is not a bug, it is by design actually.

Perhaps you could execute the script you are going to type into Before Formula Script box in Script window first, then use Set Column Value.

Regards,
Yuki

OriginLab
Go to Top of Page

redman

UK
59 Posts

Posted - 10/09/2018 :  04:34:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Redman

It is not really by design but a limitation, that "before formula scripts" cannot be updated when column position changed.


Maybe you can tell us the real user story, that you must use "before formula scripts"?

If you are setting up the worksheet in a certain way for all your work, maybe you can put the script outside, in a toolbar button? Once the worksheet is setup using such a button, then all the calculations will be in Fx and there should be no such issues.


You may want to check out the Toolbar maker App to make such a button

https://www.originlab.com/fileExchange/details.aspx?fid=430

CP
Go to Top of Page

yuki_wu

896 Posts

Posted - 10/09/2018 :  11:05:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Redman,

I agree that it is better to change the formula automatically even though it includes before formula script, but so far it is too hard to detective and change the source data in script.

Thus, we only support to change the formula for those without before formula script now. I will bring up this matter at our share meeting to see if we could speed up the development of this feature.

Regards,
Yuki
OriginLab
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 10/10/2018 :  2:14:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hi Redman,

Sorry I accidentally deleted your post when trying to answer,

Hi Redman

It is not really by design but a limitation, that "before formula scripts" cannot be updated when column position changed.


Maybe you can tell us the real user story, that you must use "before formula scripts"?

If you are setting up the worksheet in a certain way for all your work, maybe you can put the script outside, in a toolbar button? Once the worksheet is setup using such a button, then all the calculations will be in Fx and there should be no such issues.


You may want to check out the Toolbar maker App to make such a button

https://www.originlab.com/fileExchange/details.aspx?fid=430

CP
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