Author |
Topic  |
|
redman
UK
59 Posts |
Posted - 10/08/2018 : 05:31:36 AM
|
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
|
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
|
 |
|
redman
UK
59 Posts |
Posted - 10/09/2018 : 04:34:25 AM
|
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
|
 |
|
yuki_wu
896 Posts |
Posted - 10/09/2018 : 11:05:50 PM
|
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
|
 |
|
cpyang
USA
1406 Posts |
Posted - 10/10/2018 : 2:14:51 PM
|
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
|
 |
|
|
Topic  |
|
|
|