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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 A bug in Set Column Values?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
redman 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;
}
4   L A T E S T    R E P L I E S    (Newest First)
cpyang 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
yuki_wu 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
redman 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 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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000